Skip to content

Commit bbc0ae4

Browse files
committed
Finish 3.3.0
2 parents 46ab36d + c3ac011 commit bbc0ae4

File tree

14 files changed

+122
-61
lines changed

14 files changed

+122
-61
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,10 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
ruby:
30-
- 2.6
31-
- 2.7
32-
- 3.0
33-
- 3.1
34-
- ruby-head
35-
- jruby
29+
ruby: ['3.0', 3.1, 3.2, ruby-head, jruby]
3630
steps:
3731
- name: Clone repository
38-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3933
- name: Set up Ruby
4034
uses: ruby/setup-ruby@v1
4135
with:
@@ -45,7 +39,30 @@ jobs:
4539
- name: Run tests
4640
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
4741
- name: Coveralls GitHub Action
48-
uses: coverallsapp/github-action@v1.1.2
49-
if: "matrix.ruby == '3.0'"
42+
uses: coverallsapp/github-action@v2
43+
if: "matrix.ruby == '3.2'"
5044
with:
5145
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
wintests:
47+
name: Win64 Ruby ${{ matrix.ruby }}
48+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
49+
runs-on: windows-latest
50+
env:
51+
CI: true
52+
ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }}
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
ruby:
57+
- 3.1
58+
steps:
59+
- name: Clone repository
60+
uses: actions/checkout@v3
61+
- name: Set up Ruby
62+
uses: ruby/setup-ruby@v1
63+
with:
64+
ruby-version: ${{ matrix.ruby }}
65+
- name: Install dependencies
66+
run: bundle install --jobs 4 --retry 3
67+
- name: Run tests
68+
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build & deploy documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: Update gh-pages with docs
11+
steps:
12+
- name: Clone repository
13+
uses: actions/checkout@v3
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: "3.1"
18+
- name: Install required gem dependencies
19+
run: gem install yard --no-document
20+
- name: Build YARD Ruby Documentation
21+
run: yardoc
22+
- name: Deploy
23+
uses: peaceiris/actions-gh-pages@v3
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: ./doc/yard
27+
publish_branch: gh-pages

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ group :debug do
1010
end
1111

1212
group :development, :test do
13-
gem 'simplecov', '~> 0.21', platforms: :mri
13+
gem 'simplecov', '~> 0.22', platforms: :mri
1414
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
1515
end

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is an [RDF.rb][] extension that provides RDF-specific [RSpec][] matchers
44
and shared examples for Ruby projects that use RDF.rb and RSpec.
55

6-
[![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec)
6+
[![Gem Version](https://badge.fury.io/rb/rdf-spec.svg)](https://badge.fury.io/rb/rdf-spec)
77
[![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)
88
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-spec?branch=develop)
99
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
@@ -30,8 +30,8 @@ Note that in most cases, if the instance is empty and mutable, the appropriate s
3030

3131
## Dependencies
3232

33-
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
34-
* [RSpec](https://rubygems.org/gems/rspec) (~> 3.10)
33+
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3)
34+
* [RSpec](https://rubygems.org/gems/rspec) (~> 3.12)
3535

3636
## Installation
3737

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ task :clean do
2424
end
2525

2626
file "etc/doap.nt" do
27-
sh "rdf serialize https://ruby-rdf.github.com/rdf/etc/doap.ttl --output etc/doap.nt"
27+
sh "rdf serialize https://ruby-rdf.github.io/rdf/etc/doap.ttl --output etc/doap.nt"
2828
end
2929

3030
FOAF_SUBJECTS = {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0
1+
3.3.0

lib/rdf/spec/enumerable.rb

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
subject { enumerable }
3030
it {is_expected.to respond_to(:supports?)}
3131

32-
describe "valid?" do
32+
describe "#valid?" do
3333
it "reports validity" do
3434
if subject.supports?(:validity)
3535
is_expected.to be_valid
@@ -72,13 +72,13 @@
7272
it {is_expected.to respond_to(:statements)}
7373
its(:statements) {is_expected.to be_a(Array)}
7474

75-
context "#statements" do
75+
describe "#statements" do
7676
specify {expect(subject.statements.size).to eq @rdf_enumerable_iv_statements.size}
7777
specify {expect(subject.statements).to all(be_a_statement)}
7878
end
7979

8080
it {is_expected.to respond_to(:has_statement?)}
81-
context "#has_statement?" do
81+
describe "#has_statement?" do
8282
let(:unknown_statement) {RDF::Statement.new(RDF::Node.new, RDF::URI.new("http://example.org/unknown"), RDF::Node.new)}
8383
it "should have all statements" do
8484
# 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 @@
112112
its(:enum_statement) {is_expected.to be_countable}
113113
its(:enum_statement) {is_expected.to be_enumerable}
114114
its(:enum_statement) {is_expected.to be_queryable}
115-
context "#enum_statement" do
115+
describe "#enum_statement" do
116116
it "should enumerate all statements" do
117117
expect(subject.enum_statement.count).to eq enumerable.each_statement.count
118118
subject.enum_statement.each do |s|
@@ -121,6 +121,16 @@
121121
end
122122
end
123123
end
124+
125+
its(:canonicalize) {is_expected.to be_an_enumerator}
126+
describe "#canonicalize" do
127+
specify {expect(subject.canonicalize.count).to eq @rdf_enumerable_iv_statements.size}
128+
specify {expect(subject.canonicalize).to all(be_a_statement)}
129+
130+
its "terms should all be in canonical form" do
131+
subject.canonicalize.terms.all? {|t| t.eql?(t.canonicalize)}
132+
end
133+
end
124134
end
125135

126136
context "when enumerating triples" do
@@ -130,12 +140,12 @@
130140
it {is_expected.to respond_to(:enum_triple)}
131141

132142
its(:triples) {is_expected.to be_a(Array)}
133-
context "#triples" do
143+
describe "#triples" do
134144
specify {expect(subject.triples.size).to eq @rdf_enumerable_iv_statements.size}
135145
specify {expect(subject.triples).to all(be_a_triple)}
136146
end
137147

138-
context "#has_triple?" do
148+
describe "#has_triple?" do
139149
specify do
140150
non_bnode_statements.each do |statement|
141151
is_expected.to have_triple(statement.to_triple)
@@ -144,7 +154,7 @@
144154
end
145155

146156
its(:each_triple) {is_expected.to be_an_enumerator}
147-
context "#each_triple" do
157+
describe "#each_triple" do
148158
specify {expect(subject.each_triple).to all(be_a_triple)}
149159
it "should iterate over all triples" do
150160
subject.each_triple do |*triple|
@@ -156,7 +166,7 @@
156166

157167
its(:enum_triple) {is_expected.to be_an_enumerator}
158168
its(:enum_triple) {is_expected.to be_countable}
159-
context "#enum_triple" do
169+
describe "#enum_triple" do
160170
it "should enumerate all triples" do
161171
expect(subject.enum_triple.count).to eq enumerable.each_triple.count
162172
subject.enum_triple.each do |s, p, o|
@@ -174,12 +184,12 @@
174184
it {is_expected.to respond_to(:enum_quad)}
175185

176186
its(:quads) {is_expected.to be_a(Array)}
177-
context "#quads" do
187+
describe "#quads" do
178188
specify {expect(subject.quads.size).to eq @rdf_enumerable_iv_statements.size}
179189
specify {expect(subject.quads).to all(be_a_quad)}
180190
end
181191

182-
context "#has_quad?" do
192+
describe "#has_quad?" do
183193
specify do
184194
if supports_named_graphs
185195
non_bnode_statements.each do |statement|
@@ -190,7 +200,7 @@
190200
end
191201

192202
its(:each_quad) {is_expected.to be_an_enumerator}
193-
context "#each_quad" do
203+
describe "#each_quad" do
194204
specify {expect(subject.each_quad).to all(be_a_quad)}
195205
it "should iterate over all quads" do
196206
subject.each_quad do |*quad|
@@ -202,7 +212,7 @@
202212

203213
its(:enum_quad) {is_expected.to be_an_enumerator}
204214
its(:enum_quad) {is_expected.to be_countable}
205-
context "#enum_quad" do
215+
describe "#enum_quad" do
206216
it "should enumerate all quads" do
207217
expect(subject.enum_quad.count).to eq enumerable.each_quad.count
208218
subject.enum_quad.each do |s, p, o, c|
@@ -220,7 +230,7 @@
220230
it {is_expected.to respond_to(:each_subject)}
221231
it {is_expected.to respond_to(:enum_subject)}
222232

223-
context "#subjects" do
233+
describe "#subjects" do
224234
subject { enumerable.subjects }
225235
specify {is_expected.to be_a(Array)}
226236
specify {is_expected.to all(be_a_resource)}
@@ -231,7 +241,7 @@
231241
end
232242
end
233243

234-
context "#has_subject?" do
244+
describe "#has_subject?" do
235245
specify do
236246
checked = []
237247
non_bnode_statements.each do |statement|
@@ -244,15 +254,15 @@
244254
end
245255

246256
its(:each_subject) {is_expected.to be_an_enumerator}
247-
context "#each_subject" do
257+
describe "#each_subject" do
248258
specify {expect(subject.each_subject.reject(&:node?).size).to eq subjects.reject(&:node?).size}
249259
specify {expect(subject.each_subject).to all(be_a_resource)}
250260
specify {subject.each_subject {|value| expect(subjects).to include(value) unless value.node?}}
251261
end
252262

253263
its(:enum_subject) {is_expected.to be_an_enumerator}
254264
its(:enum_subject) {is_expected.to be_countable}
255-
context "#enum_subject" do
265+
describe "#enum_subject" do
256266
specify {expect(subject.enum_subject.to_a.reject(&:node?).size).to eq subjects.reject(&:node?).size}
257267
it "should enumerate all subjects" do
258268
subject.enum_subject.each do |s|
@@ -270,7 +280,7 @@
270280
it {is_expected.to respond_to(:each_predicate)}
271281
it {is_expected.to respond_to(:enum_predicate)}
272282

273-
context "#predicates" do
283+
describe "#predicates" do
274284
subject { enumerable.predicates }
275285
specify {is_expected.to be_a(Array)}
276286
specify {is_expected.to all(be_a_uri)}
@@ -281,7 +291,7 @@
281291
end
282292
end
283293

284-
context "#has_predicate?" do
294+
describe "#has_predicate?" do
285295
specify do
286296
checked = []
287297
@rdf_enumerable_iv_statements.each do |statement|
@@ -294,15 +304,15 @@
294304
end
295305

296306
its(:each_predicate) {is_expected.to be_an_enumerator}
297-
context "#each_predicate" do
307+
describe "#each_predicate" do
298308
specify {expect(subject.each_predicate.to_a.size).to eq predicates.size}
299309
specify {expect(subject.each_predicate).to all(be_a_uri)}
300310
specify {subject.each_predicate {|value| expect(predicates).to include(value)}}
301311
end
302312

303313
its(:enum_predicate) {is_expected.to be_an_enumerator}
304314
its(:enum_predicate) {is_expected.to be_countable}
305-
context "#enum_predicate" do
315+
describe "#enum_predicate" do
306316
it "should enumerate all predicates" do
307317
expect(subject.enum_predicate.to_a).to include(*predicates)
308318
end
@@ -316,7 +326,7 @@
316326
it {is_expected.to respond_to(:each_object)}
317327
it {is_expected.to respond_to(:enum_object)}
318328

319-
context "#objects" do
329+
describe "#objects" do
320330
subject { enumerable.objects }
321331
specify {is_expected.to be_a(Array)}
322332
specify {is_expected.to all(be_a_term)}
@@ -327,7 +337,7 @@
327337
end
328338
end
329339

330-
context "#has_object?" do
340+
describe "#has_object?" do
331341
specify do
332342
checked = []
333343
non_bnode_statements.each do |statement|
@@ -340,15 +350,15 @@
340350
end
341351

342352
its(:each_object) {is_expected.to be_an_enumerator}
343-
context "#each_object" do
353+
describe "#each_object" do
344354
specify {expect(subject.each_object.reject(&:node?).size).to eq objects.size}
345355
specify {expect(subject.each_object).to all(be_a_term)}
346356
specify {subject.each_object {|value| expect(objects).to include(value) unless value.node?}}
347357
end
348358

349359
its(:enum_object) {is_expected.to be_an_enumerator}
350360
its(:enum_object) {is_expected.to be_countable}
351-
context "#enum_object" do
361+
describe "#enum_object" do
352362
it "should enumerate all objects" do
353363
subject.enum_object.each do |o|
354364
expect(o).to be_a_term
@@ -365,7 +375,7 @@
365375
it {is_expected.to respond_to(:each_term)}
366376
it {is_expected.to respond_to(:enum_term)}
367377

368-
context "#terms" do
378+
describe "#terms" do
369379
subject { enumerable.terms }
370380
specify {is_expected.to be_a(Array)}
371381
specify {is_expected.to all(be_a_term)}
@@ -376,7 +386,7 @@
376386
end
377387
end
378388

379-
context "#has_term?" do
389+
describe "#has_term?" do
380390
specify do
381391
checked = {}
382392
non_bnode_terms.each do |term|
@@ -389,7 +399,7 @@
389399
end
390400

391401
its(:each_term) {is_expected.to be_an_enumerator}
392-
context "#each_term" do
402+
describe "#each_term" do
393403
it 'has correct number of terms' do
394404
expected_count = non_bnode_terms.length
395405
expected_count = expected_count - 3 unless
@@ -404,7 +414,7 @@
404414

405415
its(:enum_term) {is_expected.to be_an_enumerator}
406416
its(:enum_term) {is_expected.to be_countable}
407-
context "#enum_term" do
417+
describe "#enum_term" do
408418
it "should enumerate all terms" do
409419
subject.enum_term.each do |o|
410420
expect(o).to be_a_term

lib/rdf/spec/http_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
before(:each) {WebMock.disable_net_connect!}
1313
after(:each) {WebMock.allow_net_connect!}
1414

15-
let(:uri) {"http://ruby-rdf.github.com/rdf/etc/doap.nt"}
15+
let(:uri) {"https://ruby-rdf.github.io/rdf/etc/doap.nt"}
1616

1717
let(:opened) {double("opened")}
1818
before(:each) do

lib/rdf/spec/literal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
.to eq str
9595
end
9696

97-
it "humanizes '#{value}' to '#{str}'" do
97+
it "humanizes '#{value}' to '#{human}'" do
9898
expect(RDF::Literal.new(value,
9999
datatype: datatype,
100100
canonicalize: false).humanize)

0 commit comments

Comments
 (0)