From f3da7ddaca253f1b1e112320e73eb2e9474e1d7c Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 28 Jan 2022 11:47:27 -0800 Subject: [PATCH 01/10] Update documentation links to use gh-pages, and add action to publish gh-pages from Yard docs. --- .github/workflows/ci.yml | 2 +- .github/workflows/generate-docs.yml | 27 +++++++++++++++++++++++++++ Rakefile | 2 +- lib/rdf/spec/http_adapter.rb | 2 +- rdf-spec.gemspec | 7 +++++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/generate-docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3aefe5..c7bf1e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: ruby: - 2.6 - 2.7 - - 3.0 + - "3.0" - 3.1 - ruby-head - jruby diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 0000000..b8d16ed --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -0,0 +1,27 @@ +name: Build & deploy documentation +on: + push: + branches: + - master + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + name: Update gh-pages with docs + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + - name: Install required gem dependencies + run: gem install yard --no-document + - name: Build YARD Ruby Documentation + run: yardoc + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/yard + publish_branch: gh-pages diff --git a/Rakefile b/Rakefile index b32e144..d5940d5 100755 --- a/Rakefile +++ b/Rakefile @@ -24,7 +24,7 @@ task :clean do end file "etc/doap.nt" do - sh "rdf serialize https://ruby-rdf.github.com/rdf/etc/doap.ttl --output etc/doap.nt" + sh "rdf serialize https://ruby-rdf.github.io/rdf/etc/doap.ttl --output etc/doap.nt" end FOAF_SUBJECTS = { diff --git a/lib/rdf/spec/http_adapter.rb b/lib/rdf/spec/http_adapter.rb index 917026e..d637ca3 100644 --- a/lib/rdf/spec/http_adapter.rb +++ b/lib/rdf/spec/http_adapter.rb @@ -12,7 +12,7 @@ before(:each) {WebMock.disable_net_connect!} after(:each) {WebMock.allow_net_connect!} - let(:uri) {"http://ruby-rdf.github.com/rdf/etc/doap.nt"} + let(:uri) {"https://ruby-rdf.github.io/rdf/etc/doap.nt"} let(:opened) {double("opened")} before(:each) do diff --git a/rdf-spec.gemspec b/rdf-spec.gemspec index 456b4fd..16f7119 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -10,6 +10,13 @@ Gem::Specification.new do |gem| gem.license = 'Unlicense' gem.summary = 'RSpec extensions for RDF.rb.' gem.description = 'RDF.rb extension that provides RSpec matchers and shared examples for RDF objects.' + gem.metadata = { + "documentation_uri" => "https://ruby-rdf.github.io/rdf-spec", + "bug_tracker_uri" => "https://github.com/ruby-rdf/rdf-spec/issues", + "homepage_uri" => "https://github.com/ruby-rdf/rdf-spec", + "mailing_list_uri" => "https://lists.w3.org/Archives/Public/public-rdf-ruby/", + "source_code_uri" => "https://github.com/ruby-rdf/rdf-spec", + } gem.authors = ['Arto Bendiken', 'Ben Lavender', 'Gregg Kellogg'] gem.email = 'public-rdf-ruby@w3.org' From 34a155117bd1de6d1e6151e72e1c75bda8e8689e Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 29 Jan 2022 11:35:03 -0800 Subject: [PATCH 02/10] Rspec-mocks recieve.with become more sensitive to hash vs keyword arguments for Ruby > 3. --- lib/rdf/spec/reader.rb | 6 +++--- lib/rdf/spec/writer.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rdf/spec/reader.rb b/lib/rdf/spec/reader.rb index 2871b41..4a8c5ed 100644 --- a/lib/rdf/spec/reader.rb +++ b/lib/rdf/spec/reader.rb @@ -30,7 +30,7 @@ format_class.file_extensions.each_pair do |sym, content_type| reader_mock = double("reader") expect(reader_mock).to receive(:got_here) - expect(RDF::Reader).to receive(:for).with(file_name: "foo.#{sym}").and_return(reader_class) + expect(RDF::Reader).to receive(:for).with({file_name: "foo.#{sym}"}).and_return(reader_class) RDF::Reader.open("foo.#{sym}") do |r| expect(r).to be_a(reader_class) reader_mock.got_here @@ -55,7 +55,7 @@ format_class.file_extensions.each_pair do |sym, content_type| reader_mock = double("reader") expect(reader_mock).to receive(:got_here) - expect(RDF::Reader).to receive(:for).with(file_name: "foo.#{sym}").and_return(reader_class) + expect(RDF::Reader).to receive(:for).with({file_name: "foo.#{sym}"}).and_return(reader_class) RDF::Reader.open("foo.#{sym}", file_name: "foo.#{sym}") do |r| expect(r).to be_a(reader_class) reader_mock.got_here @@ -68,7 +68,7 @@ format_class.content_types.each_pair do |content_type, formats| reader_mock = double("reader") expect(reader_mock).to receive(:got_here) - expect(RDF::Reader).to receive(:for).with(content_type: content_type, file_name: "foo").and_return(reader_class) + expect(RDF::Reader).to receive(:for).with({content_type: content_type, file_name: "foo"}).and_return(reader_class) RDF::Reader.open("foo", content_type: content_type) do |r| expect(r).to be_a(reader_class) reader_mock.got_here diff --git a/lib/rdf/spec/writer.rb b/lib/rdf/spec/writer.rb index 857aab1..0448078 100644 --- a/lib/rdf/spec/writer.rb +++ b/lib/rdf/spec/writer.rb @@ -94,7 +94,7 @@ format_class.file_extensions.each_pair do |sym, content_type| writer_mock = double("writer") expect(writer_mock).to receive(:got_here) - expect(writer_class).to receive(:for).with(file_name: "#{@rdf_writer_iv_basename}.#{sym}").and_return(writer_class) + expect(writer_class).to receive(:for).with({file_name: "#{@rdf_writer_iv_basename}.#{sym}"}).and_return(writer_class) writer_class.open("#{@rdf_writer_iv_basename}.#{sym}") do |r| expect(r).to be_a(RDF::Writer) writer_mock.got_here @@ -117,7 +117,7 @@ format_class.file_extensions.each_pair do |sym, content_type| writer_mock = double("writer") expect(writer_mock).to receive(:got_here) - expect(writer_class).to receive(:for).with(file_name: "#{@rdf_writer_iv_basename}.#{sym}").and_return(writer_class) + expect(writer_class).to receive(:for).with({file_name: "#{@rdf_writer_iv_basename}.#{sym}"}).and_return(writer_class) writer_class.open("#{@rdf_writer_iv_basename}.#{sym}", file_name: "#{@rdf_writer_iv_basename}.#{sym}") do |r| expect(r).to be_a(RDF::Writer) writer_mock.got_here @@ -129,7 +129,7 @@ format_class.content_types.each_pair do |content_type, formats| writer_mock = double("writer") expect(writer_mock).to receive(:got_here) - expect(writer_class).to receive(:for).with(content_type: content_type, file_name: @rdf_writer_iv_basename).and_return(writer_class) + expect(writer_class).to receive(:for).with({content_type: content_type, file_name: @rdf_writer_iv_basename}).and_return(writer_class) writer_class.open(@rdf_writer_iv_basename, content_type: content_type) do |r| expect(r).to be_a(RDF::Writer) writer_mock.got_here From 6adb61112b4f3c9e56db78cab3791dfa954bb6c7 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 21 Feb 2022 13:42:04 -0800 Subject: [PATCH 03/10] Small change to title for humanizing temporals. --- lib/rdf/spec/literal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdf/spec/literal.rb b/lib/rdf/spec/literal.rb index a9d4401..93f5eb9 100644 --- a/lib/rdf/spec/literal.rb +++ b/lib/rdf/spec/literal.rb @@ -94,7 +94,7 @@ .to eq str end - it "humanizes '#{value}' to '#{str}'" do + it "humanizes '#{value}' to '#{human}'" do expect(RDF::Literal.new(value, datatype: datatype, canonicalize: false).humanize) From 829d16a711d85afb136cd48b23e542b533f3e6f1 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 20 Apr 2022 11:00:37 -0700 Subject: [PATCH 04/10] Do CI on win64. --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7bf1e2..209f50c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,31 @@ jobs: if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} + wintests: + name: Win64 Ruby ${{ matrix.ruby }} + if: "contains(github.event.commits[0].message, '[ci skip]') == false" + runs-on: windows-latest + env: + CI: true + ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }} + strategy: + fail-fast: false + matrix: + ruby: + - 3.1 + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + - name: Run tests + run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.1.2 + if: "matrix.ruby == '3.0'" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From edd4993384c1bb180f53fd16fa88f8498e4b9917 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 4 Jan 2023 13:36:15 -0800 Subject: [PATCH 05/10] CI on 3.2. --- .github/workflows/ci.yml | 12 +++--------- .github/workflows/generate-docs.yml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 209f50c..18dbfee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,16 +26,10 @@ jobs: strategy: fail-fast: false matrix: - ruby: - - 2.6 - - 2.7 - - "3.0" - - 3.1 - - ruby-head - - jruby + ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -63,7 +57,7 @@ jobs: - 3.1 steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index b8d16ed..65aea93 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -10,7 +10,7 @@ jobs: name: Update gh-pages with docs steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: From d63ab2e4639d2f2f4d218f660ab85810da58ca92 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 14:50:35 -0700 Subject: [PATCH 06/10] Update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c21f6c..9f15f0f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is an [RDF.rb][] extension that provides RDF-specific [RSpec][] matchers and shared examples for Ruby projects that use RDF.rb and RSpec. -[![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec) +[![Gem Version](https://badge.fury.io/rb/rdf-spec.svg)](https://badge.fury.io/rb/rdf-spec) [![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-spec/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-spec?branch=develop) [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) From d52e9d84ad5dd1541c439dc9409d18f2f132ab9a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 23 Jul 2023 14:41:22 -0700 Subject: [PATCH 07/10] Minor change to queryable. --- .github/workflows/ci.yml | 4 ++-- lib/rdf/spec/queryable.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18dbfee..306b8ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@v2 if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -67,7 +67,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@v2 if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/rdf/spec/queryable.rb b/lib/rdf/spec/queryable.rb index 0793b92..c9d2a7b 100644 --- a/lib/rdf/spec/queryable.rb +++ b/lib/rdf/spec/queryable.rb @@ -257,13 +257,13 @@ context "triple pattern combinations" do it "?s p o" do expect(subject.query({predicate: RDF::URI("http://example.org/p"), object: RDF::Literal.new(1)}).to_a).to( - include *[RDF::Statement.new(RDF::URI("http://example.org/xi1"), RDF::URI("http://example.org/p"), 1), RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)] + include(*[RDF::Statement.new(RDF::URI("http://example.org/xi1"), RDF::URI("http://example.org/p"), 1), RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)]) ) end it "s ?p o" do expect(subject.query({subject: RDF::URI("http://example.org/xi2"), object: RDF::Literal.new(1)}).to_a).to( - include *[RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)] + include(*[RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)]) ) end end From 664dfeaaf7ccba0e083e2650b1cc5b4965d619d3 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 19 Aug 2023 14:26:54 -0700 Subject: [PATCH 08/10] Add specs for Enumerable#canonicalize. --- lib/rdf/spec/enumerable.rb | 66 ++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/lib/rdf/spec/enumerable.rb b/lib/rdf/spec/enumerable.rb index e8de956..43dd33d 100644 --- a/lib/rdf/spec/enumerable.rb +++ b/lib/rdf/spec/enumerable.rb @@ -29,7 +29,7 @@ subject { enumerable } it {is_expected.to respond_to(:supports?)} - describe "valid?" do + describe "#valid?" do it "reports validity" do if subject.supports?(:validity) is_expected.to be_valid @@ -72,13 +72,13 @@ it {is_expected.to respond_to(:statements)} its(:statements) {is_expected.to be_a(Array)} - context "#statements" do + describe "#statements" do specify {expect(subject.statements.size).to eq @rdf_enumerable_iv_statements.size} specify {expect(subject.statements).to all(be_a_statement)} end it {is_expected.to respond_to(:has_statement?)} - context "#has_statement?" do + describe "#has_statement?" do let(:unknown_statement) {RDF::Statement.new(RDF::Node.new, RDF::URI.new("http://example.org/unknown"), RDF::Node.new)} it "should have all statements" do # Don't check for BNodes, as equivalence depends on their being exactly the same, not just the same identifier. If subject is loaded separately, these won't match. @@ -112,7 +112,7 @@ its(:enum_statement) {is_expected.to be_countable} its(:enum_statement) {is_expected.to be_enumerable} its(:enum_statement) {is_expected.to be_queryable} - context "#enum_statement" do + describe "#enum_statement" do it "should enumerate all statements" do expect(subject.enum_statement.count).to eq enumerable.each_statement.count subject.enum_statement.each do |s| @@ -121,6 +121,16 @@ end end end + + its(:canonicalize) {is_expected.to be_an_enumerator} + describe "#canonicalize" do + specify {expect(subject.canonicalize.count).to eq @rdf_enumerable_iv_statements.size} + specify {expect(subject.canonicalize).to all(be_a_statement)} + + its "terms should all be in canonical form" do + subject.canonicalize.terms.all? {|t| t.eql?(t.canonicalize)} + end + end end context "when enumerating triples" do @@ -130,12 +140,12 @@ it {is_expected.to respond_to(:enum_triple)} its(:triples) {is_expected.to be_a(Array)} - context "#triples" do + describe "#triples" do specify {expect(subject.triples.size).to eq @rdf_enumerable_iv_statements.size} specify {expect(subject.triples).to all(be_a_triple)} end - context "#has_triple?" do + describe "#has_triple?" do specify do non_bnode_statements.each do |statement| is_expected.to have_triple(statement.to_triple) @@ -144,7 +154,7 @@ end its(:each_triple) {is_expected.to be_an_enumerator} - context "#each_triple" do + describe "#each_triple" do specify {expect(subject.each_triple).to all(be_a_triple)} it "should iterate over all triples" do subject.each_triple do |*triple| @@ -156,7 +166,7 @@ its(:enum_triple) {is_expected.to be_an_enumerator} its(:enum_triple) {is_expected.to be_countable} - context "#enum_triple" do + describe "#enum_triple" do it "should enumerate all triples" do expect(subject.enum_triple.count).to eq enumerable.each_triple.count subject.enum_triple.each do |s, p, o| @@ -174,12 +184,12 @@ it {is_expected.to respond_to(:enum_quad)} its(:quads) {is_expected.to be_a(Array)} - context "#quads" do + describe "#quads" do specify {expect(subject.quads.size).to eq @rdf_enumerable_iv_statements.size} specify {expect(subject.quads).to all(be_a_quad)} end - context "#has_quad?" do + describe "#has_quad?" do specify do if supports_named_graphs non_bnode_statements.each do |statement| @@ -190,7 +200,7 @@ end its(:each_quad) {is_expected.to be_an_enumerator} - context "#each_quad" do + describe "#each_quad" do specify {expect(subject.each_quad).to all(be_a_quad)} it "should iterate over all quads" do subject.each_quad do |*quad| @@ -202,7 +212,7 @@ its(:enum_quad) {is_expected.to be_an_enumerator} its(:enum_quad) {is_expected.to be_countable} - context "#enum_quad" do + describe "#enum_quad" do it "should enumerate all quads" do expect(subject.enum_quad.count).to eq enumerable.each_quad.count subject.enum_quad.each do |s, p, o, c| @@ -220,7 +230,7 @@ it {is_expected.to respond_to(:each_subject)} it {is_expected.to respond_to(:enum_subject)} - context "#subjects" do + describe "#subjects" do subject { enumerable.subjects } specify {is_expected.to be_a(Array)} specify {is_expected.to all(be_a_resource)} @@ -231,7 +241,7 @@ end end - context "#has_subject?" do + describe "#has_subject?" do specify do checked = [] non_bnode_statements.each do |statement| @@ -244,7 +254,7 @@ end its(:each_subject) {is_expected.to be_an_enumerator} - context "#each_subject" do + describe "#each_subject" do specify {expect(subject.each_subject.reject(&:node?).size).to eq subjects.reject(&:node?).size} specify {expect(subject.each_subject).to all(be_a_resource)} specify {subject.each_subject {|value| expect(subjects).to include(value) unless value.node?}} @@ -252,7 +262,7 @@ its(:enum_subject) {is_expected.to be_an_enumerator} its(:enum_subject) {is_expected.to be_countable} - context "#enum_subject" do + describe "#enum_subject" do specify {expect(subject.enum_subject.to_a.reject(&:node?).size).to eq subjects.reject(&:node?).size} it "should enumerate all subjects" do subject.enum_subject.each do |s| @@ -270,7 +280,7 @@ it {is_expected.to respond_to(:each_predicate)} it {is_expected.to respond_to(:enum_predicate)} - context "#predicates" do + describe "#predicates" do subject { enumerable.predicates } specify {is_expected.to be_a(Array)} specify {is_expected.to all(be_a_uri)} @@ -281,7 +291,7 @@ end end - context "#has_predicate?" do + describe "#has_predicate?" do specify do checked = [] @rdf_enumerable_iv_statements.each do |statement| @@ -294,7 +304,7 @@ end its(:each_predicate) {is_expected.to be_an_enumerator} - context "#each_predicate" do + describe "#each_predicate" do specify {expect(subject.each_predicate.to_a.size).to eq predicates.size} specify {expect(subject.each_predicate).to all(be_a_uri)} specify {subject.each_predicate {|value| expect(predicates).to include(value)}} @@ -302,7 +312,7 @@ its(:enum_predicate) {is_expected.to be_an_enumerator} its(:enum_predicate) {is_expected.to be_countable} - context "#enum_predicate" do + describe "#enum_predicate" do it "should enumerate all predicates" do expect(subject.enum_predicate.to_a).to include(*predicates) end @@ -316,7 +326,7 @@ it {is_expected.to respond_to(:each_object)} it {is_expected.to respond_to(:enum_object)} - context "#objects" do + describe "#objects" do subject { enumerable.objects } specify {is_expected.to be_a(Array)} specify {is_expected.to all(be_a_term)} @@ -327,7 +337,7 @@ end end - context "#has_object?" do + describe "#has_object?" do specify do checked = [] non_bnode_statements.each do |statement| @@ -340,7 +350,7 @@ end its(:each_object) {is_expected.to be_an_enumerator} - context "#each_object" do + describe "#each_object" do specify {expect(subject.each_object.reject(&:node?).size).to eq objects.size} specify {expect(subject.each_object).to all(be_a_term)} specify {subject.each_object {|value| expect(objects).to include(value) unless value.node?}} @@ -348,7 +358,7 @@ its(:enum_object) {is_expected.to be_an_enumerator} its(:enum_object) {is_expected.to be_countable} - context "#enum_object" do + describe "#enum_object" do it "should enumerate all objects" do subject.enum_object.each do |o| expect(o).to be_a_term @@ -365,7 +375,7 @@ it {is_expected.to respond_to(:each_term)} it {is_expected.to respond_to(:enum_term)} - context "#terms" do + describe "#terms" do subject { enumerable.terms } specify {is_expected.to be_a(Array)} specify {is_expected.to all(be_a_term)} @@ -376,7 +386,7 @@ end end - context "#has_term?" do + describe "#has_term?" do specify do checked = {} non_bnode_terms.each do |term| @@ -389,7 +399,7 @@ end its(:each_term) {is_expected.to be_an_enumerator} - context "#each_term" do + describe "#each_term" do it 'has correct number of terms' do expected_count = non_bnode_terms.length expected_count = expected_count - 3 unless @@ -404,7 +414,7 @@ its(:enum_term) {is_expected.to be_an_enumerator} its(:enum_term) {is_expected.to be_countable} - context "#enum_term" do + describe "#enum_term" do it "should enumerate all terms" do subject.enum_term.each do |o| expect(o).to be_a_term From 0f0b5514b3356e92172bbac2a93997880ff1085a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 21 Aug 2023 12:22:51 -0700 Subject: [PATCH 09/10] Use inferred format when dumping, if not defined in info. --- lib/rdf/spec/matchers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdf/spec/matchers.rb b/lib/rdf/spec/matchers.rb index 1f60d4d..7ec197c 100644 --- a/lib/rdf/spec/matchers.rb +++ b/lib/rdf/spec/matchers.rb @@ -325,7 +325,7 @@ def io_name info = @info.respond_to?(:information) ? @info.information : @info.inspect "Graphs identical\n" + "\n#{info + "\n" unless info.empty?}" + - "Results:\n#{actual.dump(@info.format, **dump_opts) rescue @actual.inspect}" + + "Results:\n#{actual.dump((@info.format || format), **dump_opts) rescue @actual.inspect}" + "\nDebug:\n#{@info.logger}" end From c3ac011277cf73ccbdcbc0457cd4eb21c3d5afeb Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 26 Aug 2023 13:06:53 -0700 Subject: [PATCH 10/10] Updates for version 3.3.0 with minimum Ruby version 3.0. --- .github/workflows/ci.yml | 9 ++------- Gemfile | 2 +- README.md | 4 ++-- VERSION | 2 +- rdf-spec.gemspec | 12 ++++++------ 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 306b8ac..ce959e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby] + ruby: ['3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository uses: actions/checkout@v3 @@ -40,7 +40,7 @@ jobs: run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action uses: coverallsapp/github-action@v2 - if: "matrix.ruby == '3.0'" + if: "matrix.ruby == '3.2'" with: github-token: ${{ secrets.GITHUB_TOKEN }} wintests: @@ -66,8 +66,3 @@ jobs: run: bundle install --jobs 4 --retry 3 - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2 - if: "matrix.ruby == '3.0'" - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile index 6c2ee4d..5769462 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,6 @@ group :debug do end group :development, :test do - gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov', '~> 0.22', platforms: :mri gem 'simplecov-lcov', '~> 0.8', platforms: :mri end \ No newline at end of file diff --git a/README.md b/README.md index 9f15f0f..6c55658 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ Note that in most cases, if the instance is empty and mutable, the appropriate s ## Dependencies -* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2) -* [RSpec](https://rubygems.org/gems/rspec) (~> 3.10) +* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3) +* [RSpec](https://rubygems.org/gems/rspec) (~> 3.12) ## Installation diff --git a/VERSION b/VERSION index 944880f..15a2799 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.3.0 diff --git a/rdf-spec.gemspec b/rdf-spec.gemspec index 16f7119..067b31a 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -25,15 +25,15 @@ Gem::Specification.new do |gem| gem.files = %w(AUTHORS CREDITS README.md UNLICENSE VERSION) + Dir.glob('etc/*') + Dir.glob('lib/**/*.rb') + Dir.glob('spec/*.rb') gem.require_paths = %w(lib) - gem.required_ruby_version = '>= 2.6' + gem.required_ruby_version = '>= 3.0' gem.requirements = [] - gem.add_runtime_dependency 'rdf', '~> 3.2' - gem.add_runtime_dependency 'amazing_print', '~> 1.4' - gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.2' - gem.add_runtime_dependency 'rspec', '~> 3.10' + gem.add_runtime_dependency 'rdf', '~> 3.3' + gem.add_runtime_dependency 'amazing_print', '~> 1.5' + gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.3' + gem.add_runtime_dependency 'rspec', '~> 3.12' gem.add_runtime_dependency 'rspec-its', '~> 1.3' gem.add_runtime_dependency 'rexml', '~> 3.2' # For Webmock - gem.add_runtime_dependency 'webmock', '~> 3.14' + gem.add_runtime_dependency 'webmock', '~> 3.19' gem.add_development_dependency 'yard' , '~> 0.9' gem.post_install_message = nil end