rdf-spec 1.1.0.p3 → 1.1.0p4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/rdf/spec/countable.rb +1 -1
- data/lib/rdf/spec/durable.rb +3 -3
- data/lib/rdf/spec/enumerable.rb +66 -66
- data/lib/rdf/spec/format.rb +6 -6
- data/lib/rdf/spec/indexable.rb +2 -2
- data/lib/rdf/spec/matchers.rb +38 -38
- data/lib/rdf/spec/mutable.rb +20 -20
- data/lib/rdf/spec/queryable.rb +147 -85
- data/lib/rdf/spec/reader.rb +43 -43
- data/lib/rdf/spec/transaction.rb +24 -24
- data/lib/rdf/spec/writable.rb +18 -18
- data/lib/rdf/spec/writer.rb +35 -36
- data/spec/version_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDQwNmVjMTE1MDQ2YTljYWM5NjY1MjI0NzhlNjcwNDM5NzE2Nzg0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGZlZWZhOGNiNmQyN2MyOThlZDI2MzhkYTBlNjc2MDMxNjdjMjkzNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDg5MGQ3MTlhMTVjODlmZThjN2VmM2Q0YzkyMDY0YzU0ZGU0YmM5ODRlZTFh
|
10
|
+
MGIzMmY3MDUyOTFkNjgzMTE1ZDFjNDQwM2Q2ZDgyMzE0ODRmZWQxNDY1OTll
|
11
|
+
NWIwYTJhZTQxYTJhNWRmYTI0OGRhYmYzMjRhOWNkODI0MWU1ZjE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjFiMjcxZGNlYjA2ZWI1MzZlZmU0MDhmMDlhYTcxYzkzNGIyMGJhOGFiOTc4
|
14
|
+
N2I2M2RkOWFhOWU5OTI1MDE0NTk0YWQ2YzI5MWRhMzZhOGQ2YTQ2MjY0MDI0
|
15
|
+
Y2ExYzk0YjFkOTAwZGRjMzJlMDEyMjQ4OTM1NzkzNTEzMDlkZDY=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.0p4
|
data/lib/rdf/spec/countable.rb
CHANGED
data/lib/rdf/spec/durable.rb
CHANGED
@@ -29,19 +29,19 @@ module RDF_Durable
|
|
29
29
|
subject {@load_durable.call}
|
30
30
|
it {should respond_to(:durable?)}
|
31
31
|
it "should support #durable?" do
|
32
|
-
[true,false].
|
32
|
+
expect([true,false]).to be_member(subject.durable?)
|
33
33
|
end
|
34
34
|
|
35
35
|
it {should respond_to(:nondurable?)}
|
36
36
|
it "should support #nondurable?" do
|
37
|
-
[true,false].
|
37
|
+
expect([true,false]).to be_member(@load_durable.call.nondurable?)
|
38
38
|
end
|
39
39
|
its(:nondurable?) {should_not == subject.durable?}
|
40
40
|
|
41
41
|
it "should save contents between instantiations" do
|
42
42
|
if subject.durable?
|
43
43
|
subject.load(RDF::Spec::TRIPLES_FILE)
|
44
|
-
subject.count.
|
44
|
+
expect(subject.count).to eq File.readlines(RDF::Spec::TRIPLES_FILE).size
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/rdf/spec/enumerable.rb
CHANGED
@@ -34,9 +34,9 @@ module RDF_Enumerable
|
|
34
34
|
it "returns false if any statement is invalid" do
|
35
35
|
if subject.respond_to?(:<<) && (subject.writable? rescue true)
|
36
36
|
s = RDF::Statement.from([nil, nil, nil])
|
37
|
-
s.
|
37
|
+
expect(s).not_to be_valid
|
38
38
|
subject << s
|
39
|
-
subject.
|
39
|
+
expect(subject).not_to be_valid
|
40
40
|
else
|
41
41
|
pending("can't add statement to immutable enumerable")
|
42
42
|
end
|
@@ -64,8 +64,8 @@ module RDF_Enumerable
|
|
64
64
|
its(:statements) {should be_an_enumerator}
|
65
65
|
|
66
66
|
context "#statements" do
|
67
|
-
specify {subject.statements.to_a.size.
|
68
|
-
specify {subject.statements.each { |statement| statement.
|
67
|
+
specify {expect(subject.statements.to_a.size).to eq @statements.size}
|
68
|
+
specify {subject.statements.each { |statement| expect(statement).to be_a_statement }}
|
69
69
|
end
|
70
70
|
|
71
71
|
it {should respond_to(:has_statement?)}
|
@@ -74,7 +74,7 @@ module RDF_Enumerable
|
|
74
74
|
it "should have all statements" do
|
75
75
|
# 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.
|
76
76
|
non_bnode_statements.each do |statement|
|
77
|
-
subject.
|
77
|
+
expect(subject).to have_statement(statement)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -84,20 +84,20 @@ module RDF_Enumerable
|
|
84
84
|
non_bnode_statements.each do |statement|
|
85
85
|
s = statement.dup
|
86
86
|
s.context = context
|
87
|
-
subject.
|
87
|
+
expect(subject).not_to have_statement(s)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
92
|
it "does not have an unknown statement" do
|
93
|
-
subject.
|
93
|
+
expect(subject).not_to have_statement(unknown_statement)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
97
|
it {should respond_to(:each_statement)}
|
98
98
|
its(:each_statement) {should be_an_enumerator}
|
99
99
|
it "should implement #each_statement" do
|
100
|
-
subject.each_statement { |statement| statement.
|
100
|
+
subject.each_statement { |statement| expect(statement).to be_a_statement }
|
101
101
|
end
|
102
102
|
|
103
103
|
it {should respond_to(:enum_statement)}
|
@@ -107,7 +107,7 @@ module RDF_Enumerable
|
|
107
107
|
its(:enum_statement) {should be_queryable}
|
108
108
|
context "#enum_statement" do
|
109
109
|
it "should enumerate all statements" do
|
110
|
-
subject.enum_statement.to_a.
|
110
|
+
expect(subject.enum_statement.to_a).to include(*@enumerable.each_statement.to_a)
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
@@ -120,28 +120,28 @@ module RDF_Enumerable
|
|
120
120
|
|
121
121
|
its(:triples) {should be_an_enumerator}
|
122
122
|
context "#triples" do
|
123
|
-
specify {subject.triples.to_a.size.
|
124
|
-
specify {subject.triples.each { |triple| triple.
|
123
|
+
specify {expect(subject.triples.to_a.size).to eq @statements.size}
|
124
|
+
specify {subject.triples.each { |triple| expect(triple).to be_a_triple }}
|
125
125
|
end
|
126
126
|
|
127
127
|
context "#has_triple?" do
|
128
128
|
specify do
|
129
129
|
non_bnode_statements.each do |statement|
|
130
|
-
subject.
|
130
|
+
expect(subject).to have_triple(statement.to_triple)
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
135
|
its(:each_triple) {should be_an_enumerator}
|
136
136
|
context "#each_triple" do
|
137
|
-
specify {subject.each_triple { |*triple| triple.
|
137
|
+
specify {subject.each_triple { |*triple| expect(triple).to be_a_triple }}
|
138
138
|
end
|
139
139
|
|
140
140
|
its(:enum_triple) {should be_an_enumerator}
|
141
141
|
its(:enum_triple) {should be_countable}
|
142
142
|
context "#enum_triple" do
|
143
143
|
it "should enumerate all triples" do
|
144
|
-
subject.enum_triple.to_a.
|
144
|
+
expect(subject.enum_triple.to_a).to include(*@enumerable.each_triple.to_a)
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
@@ -154,15 +154,15 @@ module RDF_Enumerable
|
|
154
154
|
|
155
155
|
its(:quads) {should be_an_enumerator}
|
156
156
|
context "#quads" do
|
157
|
-
specify {subject.quads.to_a.size.
|
158
|
-
specify {subject.quads.each { |quad| quad.
|
157
|
+
specify {expect(subject.quads.to_a.size).to eq @statements.size}
|
158
|
+
specify {subject.quads.each { |quad| expect(quad).to be_a_quad }}
|
159
159
|
end
|
160
160
|
|
161
161
|
context "#has_quad?" do
|
162
162
|
specify do
|
163
163
|
if @supports_context
|
164
164
|
non_bnode_statements.each do |statement|
|
165
|
-
subject.
|
165
|
+
expect(subject).to have_quad(statement.to_quad)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
end
|
@@ -170,14 +170,14 @@ module RDF_Enumerable
|
|
170
170
|
|
171
171
|
its(:each_quad) {should be_an_enumerator}
|
172
172
|
context "#each_quad" do
|
173
|
-
specify {subject.each_quad {|*quad| quad.
|
173
|
+
specify {subject.each_quad {|*quad| expect(quad).to be_a_quad }}
|
174
174
|
end
|
175
175
|
|
176
176
|
its(:enum_quad) {should be_an_enumerator}
|
177
177
|
its(:enum_quad) {should be_countable}
|
178
178
|
context "#enum_quad" do
|
179
179
|
it "should enumerate all quads" do
|
180
|
-
subject.enum_quad.to_a.
|
180
|
+
expect(subject.enum_quad.to_a).to include(*@enumerable.each_quad.to_a)
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
@@ -192,12 +192,12 @@ module RDF_Enumerable
|
|
192
192
|
its(:subjects) {should be_an_enumerator}
|
193
193
|
context "#subjects" do
|
194
194
|
subject {@enumerable.subjects}
|
195
|
-
specify {subject.
|
196
|
-
specify {subject.each { |value| value.
|
195
|
+
specify {expect(subject).to be_an_enumerator}
|
196
|
+
specify {subject.each { |value| expect(value).to be_a_resource }}
|
197
197
|
context ":unique => false" do
|
198
198
|
subject {@enumerable.subjects(:unique => false)}
|
199
|
-
specify {subject.
|
200
|
-
specify {subject.each { |value| value.
|
199
|
+
specify {expect(subject).to be_an_enumerator}
|
200
|
+
specify {subject.each { |value| expect(value).to be_a_resource }}
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
@@ -205,26 +205,26 @@ module RDF_Enumerable
|
|
205
205
|
specify do
|
206
206
|
checked = []
|
207
207
|
non_bnode_statements.each do |statement|
|
208
|
-
@enumerable.
|
208
|
+
expect(@enumerable).to have_subject(statement.subject) unless checked.include?(statement.subject)
|
209
209
|
checked << statement.subject
|
210
210
|
end
|
211
211
|
uri = RDF::URI.new('http://example.org/does/not/have/this/uri')
|
212
|
-
@enumerable.
|
212
|
+
expect(@enumerable).not_to have_subject(uri)
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
216
216
|
its(:each_subject) {should be_an_enumerator}
|
217
217
|
context "#each_subject" do
|
218
|
-
specify {subject.each_subject.reject(&:node?).size.
|
219
|
-
specify {subject.each_subject {|value| value.
|
220
|
-
specify {subject.each_subject {|value| subjects.
|
218
|
+
specify {expect(subject.each_subject.reject(&:node?).size).to eq subjects.size}
|
219
|
+
specify {subject.each_subject {|value| expect(value).to be_a_resource}}
|
220
|
+
specify {subject.each_subject {|value| expect(subjects).to include(value) unless value.node?}}
|
221
221
|
end
|
222
222
|
|
223
223
|
its(:enum_subject) {should be_an_enumerator}
|
224
224
|
its(:enum_subject) {should be_countable}
|
225
225
|
context "#enum_subject" do
|
226
226
|
it "should enumerate all subjects" do
|
227
|
-
subject.enum_subject.reject(&:node?).
|
227
|
+
expect(subject.enum_subject.reject(&:node?)).to include(*subjects)
|
228
228
|
end
|
229
229
|
end
|
230
230
|
end
|
@@ -239,12 +239,12 @@ module RDF_Enumerable
|
|
239
239
|
its(:predicates) {should be_an_enumerator}
|
240
240
|
context "#predicates" do
|
241
241
|
subject {@enumerable.predicates}
|
242
|
-
specify {subject.
|
243
|
-
specify {subject.each { |value| value.
|
242
|
+
specify {expect(subject).to be_an_enumerator}
|
243
|
+
specify {subject.each { |value| expect(value).to be_a_uri }}
|
244
244
|
context ":unique => false" do
|
245
245
|
subject {@enumerable.predicates(:unique => false)}
|
246
|
-
specify {subject.
|
247
|
-
specify {subject.each { |value| value.
|
246
|
+
specify {expect(subject).to be_an_enumerator}
|
247
|
+
specify {subject.each { |value| expect(value).to be_a_uri }}
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
@@ -252,26 +252,26 @@ module RDF_Enumerable
|
|
252
252
|
specify do
|
253
253
|
checked = []
|
254
254
|
@statements.each do |statement|
|
255
|
-
@enumerable.
|
255
|
+
expect(@enumerable).to have_predicate(statement.predicate) unless checked.include?(statement.predicate)
|
256
256
|
checked << statement.predicate
|
257
257
|
end
|
258
258
|
uri = RDF::URI.new('http://example.org/does/not/have/this/uri')
|
259
|
-
@enumerable.
|
259
|
+
expect(@enumerable).not_to have_predicate(uri)
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
263
263
|
its(:each_predicate) {should be_an_enumerator}
|
264
264
|
context "#each_predicate" do
|
265
|
-
specify {subject.each_predicate.to_a.size.
|
266
|
-
specify {subject.each_predicate {|value| value.
|
267
|
-
specify {subject.each_predicate {|value| predicates.
|
265
|
+
specify {expect(subject.each_predicate.to_a.size).to eq predicates.size}
|
266
|
+
specify {subject.each_predicate {|value| expect(value).to be_a_uri}}
|
267
|
+
specify {subject.each_predicate {|value| expect(predicates).to include(value)}}
|
268
268
|
end
|
269
269
|
|
270
270
|
its(:enum_predicate) {should be_an_enumerator}
|
271
271
|
its(:enum_predicate) {should be_countable}
|
272
272
|
context "#enum_predicate" do
|
273
273
|
it "should enumerate all predicates" do
|
274
|
-
subject.enum_predicate.to_a.
|
274
|
+
expect(subject.enum_predicate.to_a).to include(*predicates)
|
275
275
|
end
|
276
276
|
end
|
277
277
|
end
|
@@ -286,12 +286,12 @@ module RDF_Enumerable
|
|
286
286
|
its(:objects) {should be_an_enumerator}
|
287
287
|
context "#objects" do
|
288
288
|
subject {@enumerable.objects}
|
289
|
-
specify {subject.
|
290
|
-
specify {subject.each { |value| value.
|
289
|
+
specify {expect(subject).to be_an_enumerator}
|
290
|
+
specify {subject.each { |value| expect(value).to be_a_term }}
|
291
291
|
context ":unique => false" do
|
292
292
|
subject {@enumerable.objects(:unique => false)}
|
293
|
-
specify {subject.
|
294
|
-
specify {subject.each { |value| value.
|
293
|
+
specify {expect(subject).to be_an_enumerator}
|
294
|
+
specify {subject.each { |value| expect(value).to be_a_term }}
|
295
295
|
end
|
296
296
|
end
|
297
297
|
|
@@ -299,26 +299,26 @@ module RDF_Enumerable
|
|
299
299
|
specify do
|
300
300
|
checked = []
|
301
301
|
non_bnode_statements.each do |statement|
|
302
|
-
@enumerable.
|
302
|
+
expect(@enumerable).to have_object(statement.object) unless checked.include?(statement.object)
|
303
303
|
checked << statement.object
|
304
304
|
end
|
305
305
|
uri = RDF::URI.new('http://example.org/does/not/have/this/uri')
|
306
|
-
@enumerable.
|
306
|
+
expect(@enumerable).not_to have_object(uri)
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
310
|
its(:each_object) {should be_an_enumerator}
|
311
311
|
context "#each_object" do
|
312
|
-
specify {subject.each_object.reject(&:node?).size.
|
313
|
-
specify {subject.each_object {|value| value.
|
314
|
-
specify {subject.each_object {|value| objects.
|
312
|
+
specify {expect(subject.each_object.reject(&:node?).size).to eq objects.size}
|
313
|
+
specify {subject.each_object {|value| expect(value).to be_a_term}}
|
314
|
+
specify {subject.each_object {|value| expect(objects).to include(value) unless value.node?}}
|
315
315
|
end
|
316
316
|
|
317
317
|
its(:enum_object) {should be_an_enumerator}
|
318
318
|
its(:enum_object) {should be_countable}
|
319
319
|
context "#enum_object" do
|
320
320
|
it "should enumerate all objects" do
|
321
|
-
subject.enum_object.reject(&:node?).
|
321
|
+
expect(subject.enum_object.reject(&:node?)).to include(*objects)
|
322
322
|
end
|
323
323
|
end
|
324
324
|
end
|
@@ -332,15 +332,15 @@ module RDF_Enumerable
|
|
332
332
|
its(:contexts) {should be_an_enumerator}
|
333
333
|
describe "#contexts" do
|
334
334
|
subject {@enumerable.contexts}
|
335
|
-
specify {subject.
|
335
|
+
specify {expect(subject).to be_an_enumerator}
|
336
336
|
it "values should be resources" do
|
337
|
-
subject.each { |value| value.
|
337
|
+
subject.each { |value| expect(value).to be_a_resource }
|
338
338
|
end
|
339
339
|
context ":unique => false" do
|
340
340
|
subject {@enumerable.contexts(:unique => false)}
|
341
|
-
specify {subject.
|
341
|
+
specify {expect(subject).to be_an_enumerator}
|
342
342
|
it "values should be resources" do
|
343
|
-
subject.each { |value| value.
|
343
|
+
subject.each { |value| expect(value).to be_a_resource }
|
344
344
|
end
|
345
345
|
end
|
346
346
|
end
|
@@ -349,11 +349,11 @@ module RDF_Enumerable
|
|
349
349
|
if @supports_context
|
350
350
|
@statements.each do |statement|
|
351
351
|
if statement.has_context?
|
352
|
-
@enumerable.
|
352
|
+
expect(@enumerable).to have_context(statement.context)
|
353
353
|
end
|
354
354
|
end
|
355
355
|
uri = RDF::URI.new('http://example.org/does/not/have/this/uri')
|
356
|
-
@enumerable.
|
356
|
+
expect(@enumerable).not_to have_context(uri)
|
357
357
|
end
|
358
358
|
end
|
359
359
|
|
@@ -362,14 +362,14 @@ module RDF_Enumerable
|
|
362
362
|
let(:contexts) {@statements.map { |s| s.context }.uniq.compact}
|
363
363
|
it "has appropriate number of contexts" do
|
364
364
|
if @supports_context
|
365
|
-
subject.each_context.to_a.size.
|
365
|
+
expect(subject.each_context.to_a.size).to eq contexts.size
|
366
366
|
end
|
367
367
|
end
|
368
368
|
it "values should be resources" do
|
369
|
-
subject.each_context {|value| value.
|
369
|
+
subject.each_context {|value| expect(value).to be_a_resource}
|
370
370
|
end
|
371
371
|
it "should have all contexts" do
|
372
|
-
subject.each_context {|value| contexts.
|
372
|
+
subject.each_context {|value| expect(contexts).to include(value)}
|
373
373
|
end
|
374
374
|
end
|
375
375
|
|
@@ -377,7 +377,7 @@ module RDF_Enumerable
|
|
377
377
|
its(:enum_context) {should be_countable}
|
378
378
|
context "#enum_context" do
|
379
379
|
it "should enumerate all contexts" do
|
380
|
-
subject.enum_context.to_a.
|
380
|
+
expect(subject.enum_context.to_a).to include(*@enumerable.each_context.to_a)
|
381
381
|
end
|
382
382
|
end
|
383
383
|
end
|
@@ -390,16 +390,16 @@ module RDF_Enumerable
|
|
390
390
|
subject {@enumerable.each_graph}
|
391
391
|
it {should be_an_enumerator}
|
392
392
|
it "are all graphs" do
|
393
|
-
subject.each { |value| value.
|
393
|
+
subject.each { |value| expect(value).to be_a_graph } if @supports_context
|
394
394
|
end
|
395
395
|
end
|
396
396
|
|
397
397
|
describe "#enum_graph" do
|
398
398
|
subject {@enumerable.enum_graph}
|
399
|
-
it {
|
400
|
-
it {
|
399
|
+
it {should be_an_enumerator}
|
400
|
+
it {should be_countable}
|
401
401
|
it "enumerates the same as #each_graph" do
|
402
|
-
subject.to_a.should =~ @enumerable.each_graph.to_a if @supports_context
|
402
|
+
subject.to_a.should =~ @enumerable.each_graph.to_a if @supports_context # expect with match problematic
|
403
403
|
end
|
404
404
|
end
|
405
405
|
end
|
@@ -409,7 +409,7 @@ module RDF_Enumerable
|
|
409
409
|
its(:to_hash) {should be_instance_of(Hash)}
|
410
410
|
context "#to_hash" do
|
411
411
|
it "should have as many keys as subjects" do
|
412
|
-
subject.to_hash.keys.size.
|
412
|
+
expect(subject.to_hash.keys.size).to eq @enumerable.subjects.to_a.size
|
413
413
|
end
|
414
414
|
end
|
415
415
|
end
|
@@ -418,11 +418,11 @@ module RDF_Enumerable
|
|
418
418
|
it {should respond_to(:dump)}
|
419
419
|
|
420
420
|
it "should implement #dump" do
|
421
|
-
subject.dump(:ntriples).
|
421
|
+
expect(subject.dump(:ntriples)).to eq RDF::NTriples::Writer.buffer() {|w| w << @enumerable}
|
422
422
|
end
|
423
423
|
|
424
424
|
it "raises error on unknown format" do
|
425
|
-
|
425
|
+
expect {subject.dump(:foobar)}.to raise_error(RDF::WriterError, /No writer found/)
|
426
426
|
end
|
427
427
|
end
|
428
428
|
end
|
data/lib/rdf/spec/format.rb
CHANGED
@@ -13,21 +13,21 @@ module RDF_Format
|
|
13
13
|
describe ".for" do
|
14
14
|
RDF::Format.file_extensions.each do |ext, formats|
|
15
15
|
it "detects #{formats.first} using file path foo.#{ext}" do
|
16
|
-
RDF::Format.for("foo.#{ext}").
|
16
|
+
expect(RDF::Format.for("foo.#{ext}")).to eq formats.first
|
17
17
|
end
|
18
18
|
|
19
19
|
it "detects #{formats.first} using file_name foo.#{ext}" do
|
20
|
-
RDF::Format.for(:file_name => "foo.#{ext}").
|
20
|
+
expect(RDF::Format.for(:file_name => "foo.#{ext}")).to eq formats.first
|
21
21
|
end
|
22
22
|
|
23
23
|
it "detects #{formats.first} using file_extension #{ext}" do
|
24
|
-
RDF::Format.for(:file_extension => ext).
|
24
|
+
expect(RDF::Format.for(:file_extension => ext)).to eq formats.first
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
RDF::Format.content_types.each do |content_type, formats|
|
29
29
|
it "detects #{formats.first} using content_type #{content_type}" do
|
30
|
-
RDF::Format.for(:content_type => content_type).
|
30
|
+
expect(RDF::Format.for(:content_type => content_type)).to eq formats.first
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -35,7 +35,7 @@ module RDF_Format
|
|
35
35
|
describe ".reader" do
|
36
36
|
it "returns a reader" do
|
37
37
|
subject.each do |f|
|
38
|
-
f.reader.
|
38
|
+
expect(f.reader).not_to be_nil
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -46,7 +46,7 @@ module RDF_Format
|
|
46
46
|
it "returns a writer" do
|
47
47
|
subject.each do |f|
|
48
48
|
format_namespace = f.name.split('::')[0..-2].inject(Kernel) {|base, const| base.const_get(const)}
|
49
|
-
f.writer.
|
49
|
+
expect(f.writer).not_to be_nil if format_namespace.const_defined?(:Writer)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|