rdf-spec 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +15 -0
  2. data/VERSION +1 -1
  3. data/lib/rdf/spec/enumerable.rb +25 -21
  4. metadata +5 -13
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTgzNTRlNWI0ZjIxMDFlZjQ4MGQyNzIwMjAyZWFmOGFkOGZkNzg2MQ==
5
+ data.tar.gz: !binary |-
6
+ ZWQxZjI3OGRiZWE5ZjllYzQ3NDYwZjEzMTI3ZjFjZjljMmU0MzQ4NA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YzAxMWM1Zjc1MjI1Njk1NDAyMDU5MTgwYWIwMGQ1MGVjNTJiY2E1MjE0MTcx
10
+ YTE3NWFlMmRkNGFlYzg0MGY3NGUyYjU0NzE4NjVkNTU0ZDhlYmNhY2ZiYTUx
11
+ MDFhNGRjNjQ3NDU4OTYwOGJiMGQ3NTc3ZDAwYzBkMmZhYTY3NDI=
12
+ data.tar.gz: !binary |-
13
+ YmMzNzBlYzNiYmYwMTZhODQ2N2FjMGZhYzVlMzYzZjg3NjUwNWZkMmM2MWUx
14
+ NmEzZTBmMzliNTNiMTgzZGI1YzkwNWQzNWYyNzczMjg4OThmYmRiN2M4NWFh
15
+ NmZmMWY0ODY5MDliY2EwNmRkZjgxMjlmNDMxZGRkNGM4MGY4Nzc=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.6
1
+ 1.0.7
@@ -21,6 +21,10 @@ module RDF_Enumerable
21
21
  end
22
22
 
23
23
  describe RDF::Enumerable do
24
+ let(:subject_count) {@statements.map(&:subject).uniq.length}
25
+ let(:bnode_subject_count) {@statements.map(&:subject).uniq.select(&:node?).length}
26
+ let(:non_bnode_statements) {@statements.reject {|s| s.subject.node? || s.object.node?}}
27
+
24
28
  subject {@enumerable}
25
29
  it {should respond_to(:supports?)}
26
30
 
@@ -69,7 +73,7 @@ module RDF_Enumerable
69
73
  let(:unknown_statement) {RDF::Statement.new(RDF::Node.new, RDF::URI.new("http://example.org/unknown"), RDF::Node.new)}
70
74
  it "should have all statements" do
71
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.
72
- @statements.reject {|s| s.to_a.any?(&:node?)}.each do |statement|
76
+ non_bnode_statements.each do |statement|
73
77
  subject.has_statement?(statement).should be_true
74
78
  end
75
79
  end
@@ -77,7 +81,7 @@ module RDF_Enumerable
77
81
  it "does not have statement in different context" do
78
82
  if @supports_context
79
83
  context = RDF::URI.new("urn:context:1")
80
- @statements.each do |statement|
84
+ non_bnode_statements.each do |statement|
81
85
  s = statement.dup
82
86
  s.context = context
83
87
  subject.has_statement?(s).should be_false
@@ -103,7 +107,7 @@ module RDF_Enumerable
103
107
  its(:enum_statement) {should be_queryable}
104
108
  context "#enum_statement" do
105
109
  it "should enumerate all statements" do
106
- subject.enum_statement.to_a.should == @enumerable.each_statement.to_a
110
+ subject.enum_statement.to_a.should =~ @enumerable.each_statement.to_a
107
111
  end
108
112
  end
109
113
  end
@@ -122,7 +126,7 @@ module RDF_Enumerable
122
126
 
123
127
  context "#has_triple?" do
124
128
  specify do
125
- @statements.each do |statement|
129
+ non_bnode_statements.each do |statement|
126
130
  subject.has_triple?(statement.to_triple).should be_true
127
131
  end
128
132
  end
@@ -137,7 +141,7 @@ module RDF_Enumerable
137
141
  its(:enum_triple) {should be_countable}
138
142
  context "#enum_triple" do
139
143
  it "should enumerate all triples" do
140
- subject.enum_triple.to_a.should == @enumerable.each_triple.to_a
144
+ subject.enum_triple.to_a.should =~ @enumerable.each_triple.to_a
141
145
  end
142
146
  end
143
147
  end
@@ -157,7 +161,7 @@ module RDF_Enumerable
157
161
  context "#has_quad?" do
158
162
  specify do
159
163
  if @supports_context
160
- @statements.each do |statement|
164
+ non_bnode_statements.each do |statement|
161
165
  subject.has_quad?(statement.to_quad).should be_true
162
166
  end
163
167
  end
@@ -173,12 +177,13 @@ module RDF_Enumerable
173
177
  its(:enum_quad) {should be_countable}
174
178
  context "#enum_quad" do
175
179
  it "should enumerate all quads" do
176
- subject.enum_quad.to_a.should == @enumerable.each_quad.to_a
180
+ subject.enum_quad.to_a.should =~ @enumerable.each_quad.to_a
177
181
  end
178
182
  end
179
183
  end
180
184
 
181
185
  context "when enumerating subjects" do
186
+ let(:subjects) {subject.map { |s| s.subject }.reject(&:node?).uniq}
182
187
  it {should respond_to(:subjects)}
183
188
  it {should respond_to(:has_subject?)}
184
189
  it {should respond_to(:each_subject)}
@@ -199,7 +204,7 @@ module RDF_Enumerable
199
204
  context "#has_subject?" do
200
205
  specify do
201
206
  checked = []
202
- @statements.each do |statement|
207
+ non_bnode_statements.each do |statement|
203
208
  @enumerable.has_subject?(statement.subject).should be_true unless checked.include?(statement.subject)
204
209
  checked << statement.subject
205
210
  end
@@ -210,22 +215,22 @@ module RDF_Enumerable
210
215
 
211
216
  its(:each_subject) {should be_an_enumerator}
212
217
  context "#each_subject" do
213
- let(:subjects) {@statements.map { |s| s.subject }.uniq}
214
- specify {subject.each_subject.to_a.size.should == subjects.size}
218
+ specify {subject.each_subject.reject(&:node?).size.should == subjects.size}
215
219
  specify {subject.each_subject {|value| value.should be_a_resource}}
216
- specify {subject.each_subject {|value| subjects.should include(value)}}
220
+ specify {subject.each_subject {|value| subjects.should include(value) unless value.node?}}
217
221
  end
218
222
 
219
223
  its(:enum_subject) {should be_an_enumerator}
220
224
  its(:enum_subject) {should be_countable}
221
225
  context "#enum_subject" do
222
226
  it "should enumerate all subjects" do
223
- subject.enum_subject.to_a.should == @enumerable.each_subject.to_a
227
+ subject.enum_subject.reject(&:node?).should =~ subjects
224
228
  end
225
229
  end
226
230
  end
227
231
 
228
232
  context "when enumerating predicates" do
233
+ let(:predicates) {@statements.map { |s| s.predicate }.uniq}
229
234
  it {should respond_to(:predicates)}
230
235
  it {should respond_to(:has_predicate?)}
231
236
  it {should respond_to(:each_predicate)}
@@ -257,7 +262,6 @@ module RDF_Enumerable
257
262
 
258
263
  its(:each_predicate) {should be_an_enumerator}
259
264
  context "#each_predicate" do
260
- let(:predicates) {@statements.map { |s| s.predicate }.uniq}
261
265
  specify {subject.each_predicate.to_a.size.should == predicates.size}
262
266
  specify {subject.each_predicate {|value| value.should be_a_uri}}
263
267
  specify {subject.each_predicate {|value| predicates.should include(value)}}
@@ -267,12 +271,13 @@ module RDF_Enumerable
267
271
  its(:enum_predicate) {should be_countable}
268
272
  context "#enum_predicate" do
269
273
  it "should enumerate all predicates" do
270
- subject.enum_predicate.to_a.should == @enumerable.each_predicate.to_a
274
+ subject.enum_predicate.to_a.should =~ predicates
271
275
  end
272
276
  end
273
277
  end
274
278
 
275
279
  context "when enumerating objects" do
280
+ let(:objects) {subject.map(&:object).reject(&:node?).uniq}
276
281
  it {should respond_to(:objects)}
277
282
  it {should respond_to(:has_object?)}
278
283
  it {should respond_to(:each_object)}
@@ -293,7 +298,7 @@ module RDF_Enumerable
293
298
  context "#has_object?" do
294
299
  specify do
295
300
  checked = []
296
- @statements.each do |statement|
301
+ non_bnode_statements.each do |statement|
297
302
  @enumerable.has_object?(statement.object).should be_true unless checked.include?(statement.object)
298
303
  checked << statement.object
299
304
  end
@@ -304,17 +309,16 @@ module RDF_Enumerable
304
309
 
305
310
  its(:each_object) {should be_an_enumerator}
306
311
  context "#each_object" do
307
- let(:objects) {@statements.map { |s| s.object }.uniq}
308
- specify {subject.each_object.to_a.size.should == objects.size}
312
+ specify {subject.each_object.reject(&:node?).size.should == objects.size}
309
313
  specify {subject.each_object {|value| value.should be_a_term}}
310
- specify {subject.each_object {|value| objects.should include(value)}}
314
+ specify {subject.each_object {|value| objects.should include(value) unless value.node?}}
311
315
  end
312
316
 
313
317
  its(:enum_object) {should be_an_enumerator}
314
318
  its(:enum_object) {should be_countable}
315
319
  context "#enum_object" do
316
320
  it "should enumerate all objects" do
317
- subject.enum_object.to_a.should == @enumerable.each_object.to_a
321
+ subject.enum_object.reject(&:node?).should =~ objects
318
322
  end
319
323
  end
320
324
  end
@@ -373,7 +377,7 @@ module RDF_Enumerable
373
377
  its(:enum_context) {should be_countable}
374
378
  context "#enum_context" do
375
379
  it "should enumerate all contexts" do
376
- subject.enum_context.to_a.should == @enumerable.each_context.to_a
380
+ subject.enum_context.to_a.should =~ @enumerable.each_context.to_a
377
381
  end
378
382
  end
379
383
  end
@@ -393,7 +397,7 @@ module RDF_Enumerable
393
397
  it {subject.should be_an_enumerator}
394
398
  it {subject.should be_countable}
395
399
  it "enumerates the same as #each_graph" do
396
- subject.to_a.should == @enumerable.each_graph.to_a
400
+ subject.to_a.should =~ @enumerable.each_graph.to_a
397
401
  end
398
402
  end
399
403
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
5
- prerelease:
4
+ version: 1.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Arto Bendiken
@@ -11,12 +10,11 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-04-29 00:00:00.000000000 Z
13
+ date: 2013-06-16 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rdf
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - ~>
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :development
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - ~>
30
27
  - !ruby/object:Gem::Version
@@ -32,7 +29,6 @@ dependencies:
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: rspec
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
33
  - - ! '>='
38
34
  - !ruby/object:Gem::Version
@@ -40,7 +36,6 @@ dependencies:
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
40
  - - ! '>='
46
41
  - !ruby/object:Gem::Version
@@ -48,7 +43,6 @@ dependencies:
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: yard
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
47
  - - ! '>='
54
48
  - !ruby/object:Gem::Version
@@ -56,7 +50,6 @@ dependencies:
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
54
  - - ! '>='
62
55
  - !ruby/object:Gem::Version
@@ -102,27 +95,26 @@ files:
102
95
  homepage: http://github.com/ruby-rdf/rdf-spec/
103
96
  licenses:
104
97
  - Public Domain
98
+ metadata: {}
105
99
  post_install_message:
106
100
  rdoc_options: []
107
101
  require_paths:
108
102
  - lib
109
103
  required_ruby_version: !ruby/object:Gem::Requirement
110
- none: false
111
104
  requirements:
112
105
  - - ! '>='
113
106
  - !ruby/object:Gem::Version
114
107
  version: 1.8.1
115
108
  required_rubygems_version: !ruby/object:Gem::Requirement
116
- none: false
117
109
  requirements:
118
110
  - - ! '>='
119
111
  - !ruby/object:Gem::Version
120
112
  version: '0'
121
113
  requirements: []
122
114
  rubyforge_project: rdf
123
- rubygems_version: 1.8.25
115
+ rubygems_version: 2.0.3
124
116
  signing_key:
125
- specification_version: 3
117
+ specification_version: 4
126
118
  summary: RSpec extensions for RDF.rb.
127
119
  test_files: []
128
120
  has_rdoc: false