Skip to content

Commit

Permalink
Finish 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Sep 1, 2023
2 parents 46ab36d + c3ac011 commit bbc0ae4
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 61 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- 3.0
- 3.1
- ruby-head
- jruby
ruby: ['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:
Expand All @@ -45,7 +39,30 @@ jobs:
- 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'"
uses: coverallsapp/github-action@v2
if: "matrix.ruby == '3.2'"
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@v3
- 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
27 changes: 27 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -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@v3
- 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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.3.0
66 changes: 38 additions & 28 deletions lib/rdf/spec/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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|
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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|
Expand All @@ -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|
Expand All @@ -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|
Expand All @@ -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|
Expand All @@ -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|
Expand All @@ -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)}
Expand All @@ -231,7 +241,7 @@
end
end

context "#has_subject?" do
describe "#has_subject?" do
specify do
checked = []
non_bnode_statements.each do |statement|
Expand All @@ -244,15 +254,15 @@
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?}}
end

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|
Expand All @@ -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)}
Expand All @@ -281,7 +291,7 @@
end
end

context "#has_predicate?" do
describe "#has_predicate?" do
specify do
checked = []
@rdf_enumerable_iv_statements.each do |statement|
Expand All @@ -294,15 +304,15 @@
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)}}
end

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
Expand All @@ -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)}
Expand All @@ -327,7 +337,7 @@
end
end

context "#has_object?" do
describe "#has_object?" do
specify do
checked = []
non_bnode_statements.each do |statement|
Expand All @@ -340,15 +350,15 @@
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?}}
end

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
Expand All @@ -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)}
Expand All @@ -376,7 +386,7 @@
end
end

context "#has_term?" do
describe "#has_term?" do
specify do
checked = {}
non_bnode_terms.each do |term|
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/spec/http_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/spec/literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit bbc0ae4

Please sign in to comment.