rdf-spec 1.1.0.p1 → 1.1.0.p2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,12 +9,8 @@ module RDF_Readable
9
9
  end
10
10
 
11
11
  describe RDF::Readable do
12
- it "responds to #readable?" do
13
- @readable.respond_to?(:readable?)
14
- end
15
-
16
- it "implements #readable?" do
17
- !!@readable.readable?.should == @readable.readable?
18
- end
12
+ subject {@readable}
13
+ it {should respond_to(:readable?)}
14
+ its(:readable?) {should == subject.readable?}
19
15
  end
20
16
  end
@@ -6,61 +6,50 @@ module RDF_Repository
6
6
 
7
7
  before :each do
8
8
  raise '+@repository+ must be defined in a before(:each) block' unless instance_variable_get('@repository')
9
- @filename = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'etc', 'doap.nt'))
10
- @statements = RDF::NTriples::Reader.new(File.open(@filename)).to_a
9
+ @statements = RDF::Spec.quads
10
+ if @repository.empty? && @repository.writable?
11
+ @repository.insert(*@statements)
12
+ elsif @repository.empty?
13
+ raise "+@repository+ must respond to #<< or be pre-populated with the statements in #{RDF::Spec::TRIPLES_FILE} in a before(:each) block"
14
+ end
15
+ @countable = @repository
11
16
  @enumerable = @repository
17
+ @queryable = @repository
18
+ @mutable = @repository
12
19
  end
13
20
 
14
21
  describe RDF::Repository do
22
+
15
23
  context "when counting statements" do
16
24
  require 'rdf/spec/countable'
17
-
18
- before :each do
19
- @countable = @repository
20
- @countable.insert(*@statements)
21
- end
22
-
23
25
  include RDF_Countable
24
26
  end
25
27
 
26
28
  context "when enumerating statements" do
27
29
  require 'rdf/spec/enumerable'
28
-
29
- before :each do
30
- @enumerable = @repository
31
- @enumerable.insert(*@statements)
32
- end
33
-
34
30
  include RDF_Enumerable
35
31
  end
36
32
 
37
33
  context "when querying statements" do
38
34
  require 'rdf/spec/queryable'
39
-
40
- before :each do
41
- @queryable = @repository
42
- @subject = RDF::URI.new('http://rubygems.org/gems/rdf')
43
- end
44
-
45
35
  include RDF_Queryable
46
36
  end
47
37
 
38
+ # FIXME: This should be condition on the repository being mutable
48
39
  context "when updating" do
49
40
  require 'rdf/spec/mutable'
50
-
51
- before :each do
52
- @mutable = @repository
53
- @subject = RDF::URI.new('http://rubygems.org/gems/rdf')
54
- @context = RDF::URI.new('http://example.org/context')
41
+ before(:each) do
42
+ @mutable.clear
55
43
  end
56
-
57
44
  include RDF_Mutable
58
45
  end
59
46
 
47
+ # FIXME: This should be condition on the repository being mutable
60
48
  context "as a durable repository" do
61
49
  require 'rdf/spec/durable'
62
50
 
63
51
  before :each do
52
+ @repository.clear
64
53
  @load_durable ||= lambda { @repository }
65
54
  end
66
55
 
@@ -7,117 +7,130 @@ module RDF_Writable
7
7
  before :each do
8
8
  raise '+@writable+ must be defined in a before(:each) block' unless instance_variable_get('@writable')
9
9
 
10
- @filename = File.expand_path("../../../../etc/doap.nt", __FILE__)
10
+ @filename = RDF::Spec::TRIPLES_FILE
11
11
  @statements = RDF::NTriples::Reader.new(File.open(@filename)).to_a
12
12
 
13
13
  @supports_context = @writable.respond_to?(:supports?) && @writable.supports?(:context)
14
14
  end
15
15
 
16
16
  describe RDF::Writable do
17
- it "responds to #writable?" do
18
- @writable.respond_to?(:readable?)
19
- end
20
-
21
- it "implements #writable?" do
22
- !!@writable.writable?.should == @writable.writable?
23
- end
17
+ subject {@writable}
18
+ let(:statement) {@statements.detect {|s| s.to_a.all? {|r| r.uri?}}}
19
+ let(:count) {@statements.size}
24
20
 
21
+ it {should respond_to(:writable?)}
22
+ its(:writable?) {should == !!subject.writable?}
23
+
25
24
  describe "#<<" do
26
25
  it "inserts a reader" do
27
- reader = RDF::NTriples::Reader.new(File.open(@filename)).to_a
28
- @writable << reader
29
- @writable.should have_statement(@statements.first)
30
- @writable.count.should == @statements.size
26
+ pending("writability", :unless => subject.writable?) do
27
+ reader = RDF::NTriples::Reader.new(File.open(@filename)).to_a
28
+ subject << reader
29
+ subject.should have_statement(statement)
30
+ subject.count.should == count
31
+ end
31
32
  end
32
33
 
33
34
  it "inserts a graph" do
34
- graph = RDF::Graph.new << @statements
35
- @writable << graph
36
- @writable.should have_statement(@statements.first)
37
- @writable.count.should == @statements.size
35
+ pending("writability", :unless => subject.writable?) do
36
+ graph = RDF::Graph.new << @statements
37
+ subject << graph
38
+ subject.should have_statement(statement)
39
+ subject.count.should == count
40
+ end
38
41
  end
39
42
 
40
43
  it "inserts an enumerable" do
41
- enumerable = @statements.dup.extend(RDF::Enumerable)
42
- @writable << enumerable
43
- @writable.should have_statement(@statements.first)
44
- @writable.count.should == @statements.size
44
+ pending("writability", :unless => subject.writable?) do
45
+ enumerable = @statements.dup.extend(RDF::Enumerable)
46
+ subject << enumerable
47
+ subject.should have_statement(statement)
48
+ subject.count.should == count
49
+ end
45
50
  end
46
51
 
47
52
  it "inserts data responding to #to_rdf" do
48
- mock = double('mock')
49
- mock.stub(:to_rdf).and_return(@statements)
50
- @writable << mock
51
- @writable.should have_statement(@statements.first)
52
- @writable.count.should == @statements.size
53
+ pending("writability", :unless => subject.writable?) do
54
+ mock = double('mock')
55
+ mock.stub(:to_rdf).and_return(@statements)
56
+ subject << mock
57
+ subject.should have_statement(statement)
58
+ subject.count.should == count
59
+ end
53
60
  end
54
61
 
55
62
  it "inserts a statement" do
56
- @writable << @statements.first
57
- @writable.should have_statement(@statements.first)
58
- @writable.count.should == 1
63
+ pending("writability", :unless => subject.writable?) do
64
+ subject << statement
65
+ subject.should have_statement(statement)
66
+ subject.count.should == 1
67
+ end
59
68
  end
60
69
 
61
70
  it "inserts an invalid statement" do
62
- s = RDF::Statement.from([nil, nil, nil])
63
- s.should_not be_valid
64
- @writable << s
65
- @writable.count.should == 1
71
+ pending("writability", :unless => subject.writable?) do
72
+ s = RDF::Statement.from([nil, nil, nil])
73
+ s.should_not be_valid
74
+ subject << s
75
+ subject.count.should == 1
76
+ end
66
77
  end
67
78
  end
68
79
 
69
80
  context "when inserting statements" do
70
81
  it "should support #insert" do
71
- @writable.should respond_to(:insert)
82
+ pending("writability", :unless => subject.writable?) do
83
+ subject.should respond_to(:insert)
84
+ end
72
85
  end
73
86
 
74
87
  it "should not raise errors" do
75
- if @writable.writable?
76
- lambda { @writable.insert(@statements.first) }.should_not raise_error
88
+ pending("writability", :unless => subject.writable?) do
89
+ lambda { subject.insert(statement) }.should_not raise_error
77
90
  end
78
91
  end
79
92
 
80
93
  it "should support inserting one statement at a time" do
81
- if @writable.writable?
82
- @writable.insert(@statements.first)
83
- @writable.should have_statement(@statements.first)
94
+ pending("writability", :unless => subject.writable?) do
95
+ subject.insert(statement)
96
+ subject.should have_statement(statement)
84
97
  end
85
98
  end
86
99
 
87
100
  it "should support inserting multiple statements at a time" do
88
- if @writable.writable?
89
- @writable.insert(*@statements)
101
+ pending("writability", :unless => subject.writable?) do
102
+ subject.insert(*@statements)
90
103
  end
91
104
  end
92
105
 
93
106
  it "should insert statements successfully" do
94
- if @writable.writable?
95
- @writable.insert(*@statements)
96
- @writable.count.should == @statements.size
107
+ pending("writability", :unless => subject.writable?) do
108
+ subject.insert(*@statements)
109
+ subject.count.should == count
97
110
  end
98
111
  end
99
112
 
100
113
  it "should not insert a statement twice" do
101
- if @writable.writable?
102
- @writable.insert(@statements.first)
103
- @writable.insert(@statements.first)
104
- @writable.count.should == 1
114
+ pending("writability", :unless => subject.writable?) do
115
+ subject.insert(statement)
116
+ subject.insert(statement)
117
+ subject.count.should == 1
105
118
  end
106
119
  end
107
120
 
108
121
  it "should treat statements with a different context as distinct" do
109
- if @writable.writable?
110
- s1 = @statements.first.dup
122
+ pending("writability", :unless => subject.writable?) do
123
+ s1 = statement.dup
111
124
  s1.context = nil
112
- s2 = @statements.first.dup
125
+ s2 = statement.dup
113
126
  s2.context = RDF::URI.new("urn:context:1")
114
- s3 = @statements.first.dup
127
+ s3 = statement.dup
115
128
  s3.context = RDF::URI.new("urn:context:2")
116
- @writable.insert(s1)
117
- @writable.insert(s2)
118
- @writable.insert(s3)
129
+ subject.insert(s1)
130
+ subject.insert(s2)
131
+ subject.insert(s3)
119
132
  # If contexts are not suported, all three are redundant
120
- @writable.count.should == (@supports_context ? 3 : 1)
133
+ subject.count.should == (@supports_context ? 3 : 1)
121
134
  end
122
135
  end
123
136
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.p1
4
+ version: 1.1.0.p2
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - Arto Bendiken
@@ -10,11 +11,12 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-04-13 00:00:00.000000000 Z
14
+ date: 2013-05-01 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rdf
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
21
  - - ~>
20
22
  - !ruby/object:Gem::Version
@@ -22,6 +24,7 @@ dependencies:
22
24
  type: :development
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
29
  - - ~>
27
30
  - !ruby/object:Gem::Version
@@ -29,6 +32,7 @@ dependencies:
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: rspec
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
37
  - - ! '>='
34
38
  - !ruby/object:Gem::Version
@@ -36,6 +40,7 @@ dependencies:
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
45
  - - ! '>='
41
46
  - !ruby/object:Gem::Version
@@ -43,6 +48,7 @@ dependencies:
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: yard
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
53
  - - ! '>='
48
54
  - !ruby/object:Gem::Version
@@ -50,6 +56,7 @@ dependencies:
50
56
  type: :development
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
61
  - - ! '>='
55
62
  - !ruby/object:Gem::Version
@@ -67,18 +74,12 @@ files:
67
74
  - UNLICENSE
68
75
  - VERSION
69
76
  - etc/bendiken.nq
70
- - etc/bendiken.nt
71
- - etc/bendiken.ttl
72
77
  - etc/bhuga.nq
73
- - etc/bhuga.nt
74
- - etc/bhuga.ttl
75
- - etc/doap.nq
76
78
  - etc/doap.nt
77
- - etc/doap.ttl
78
79
  - etc/gkellogg.nq
79
- - etc/gkellogg.nt
80
- - etc/gkellogg.ttl
80
+ - etc/quads.nq
81
81
  - etc/test-data.nt
82
+ - etc/triples.nt
82
83
  - lib/rdf/spec/countable.rb
83
84
  - lib/rdf/spec/durable.rb
84
85
  - lib/rdf/spec/enumerable.rb
@@ -101,26 +102,27 @@ files:
101
102
  homepage: http://ruby-rdf.github.com/rdf-spec/
102
103
  licenses:
103
104
  - Public Domain
104
- metadata: {}
105
105
  post_install_message:
106
106
  rdoc_options: []
107
107
  require_paths:
108
108
  - lib
109
109
  required_ruby_version: !ruby/object:Gem::Requirement
110
+ none: false
110
111
  requirements:
111
112
  - - ! '>='
112
113
  - !ruby/object:Gem::Version
113
114
  version: 1.9.2
114
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
+ none: false
115
117
  requirements:
116
118
  - - ! '>'
117
119
  - !ruby/object:Gem::Version
118
120
  version: 1.3.1
119
121
  requirements: []
120
122
  rubyforge_project: rdf
121
- rubygems_version: 2.0.3
123
+ rubygems_version: 1.8.25
122
124
  signing_key:
123
- specification_version: 4
125
+ specification_version: 3
124
126
  summary: RSpec extensions for RDF.rb.
125
127
  test_files: []
126
128
  has_rdoc: false
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODg3NTI1YWRkOTRhYTJmYzJhNGU4M2I3YzI3ZWZkODNmNmY3MWE2NA==
5
- data.tar.gz: !binary |-
6
- ZmVjMjZjZDllNDA1Nzk1NTA0MDlkZjk2YTUwYTViMDA5NGU5OGEyMA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- M2FmNTVlYzc3YTBkYTA4ZDUzMjYyZGU5MzZmNzBhNTc5NzE0ZTUyMmM4YWY3
10
- ODFmZjVjNGViMWE2YWM4ZWRmMGMwYWY3MTZjNmViNTM2M2NiNjI0MGFjM2Qy
11
- NTFiYmVhNDc2MTFjYzYwM2I0M2M2MzE2ZmRjMmIyYWM0ZGY3Njg=
12
- data.tar.gz: !binary |-
13
- NDY1Mjc3YWE2NWY2MWUyMTg0NjM1NDc2NTI3ZWE5MGNjZTZiYjU2YmQwZDEw
14
- YjU2MzExZTEyY2IzZjdlMjFlMDQ1ODc0ZmY4MzYxNGNmMzgyZGRmZjJhODFk
15
- ZWRhNjRjYmE2MTZhYTZjNjZkZWZkNjhiYzE1NGRlMmM5YTk0YmY=
data/etc/bendiken.nt DELETED
@@ -1,8 +0,0 @@
1
- <http://ar.to/#self> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
2
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/name> "Arto Bendiken" .
3
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox> <mailto:arto.bendiken@gmail.com> .
4
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "d0737cceb55eb7d740578d2db1bc0727e3ed49ce" .
5
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "a033f652c84a4d73b8c26d318c2395699dd2bdfb" .
6
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/homepage> <http://ar.to/> .
7
- <http://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <http://rubygems.org/gems/rdf> .
8
- <http://ar.to/#self> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bendiken/foaf> .
data/etc/bendiken.ttl DELETED
@@ -1,17 +0,0 @@
1
- @base <http://rubygems.org/gems/rdf> .
2
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
- @prefix dc: <http://purl.org/dc/terms/> .
5
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
6
- @prefix doap: <http://usefulinc.com/ns/doap#> .
7
- @prefix ex: <http://example.org/> .
8
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
-
10
- <http://ar.to/#self> a foaf:Person ;
11
- foaf:name "Arto Bendiken" ;
12
- foaf:mbox <mailto:arto.bendiken@gmail.com> ;
13
- foaf:mbox_sha1sum "d0737cceb55eb7d740578d2db1bc0727e3ed49ce",
14
- "a033f652c84a4d73b8c26d318c2395699dd2bdfb" ;
15
- foaf:homepage <http://ar.to/> ;
16
- foaf:made <> ;
17
- rdfs:isDefinedBy <http://datagraph.org/bendiken/foaf> .
data/etc/bhuga.nt DELETED
@@ -1,6 +0,0 @@
1
- <http://bhuga.net/#ben> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
2
- <http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/name> "Ben Lavender" .
3
- <http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/mbox> <mailto:blavender@gmail.com> .
4
- <http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "dbf45f4ffbd27b67aa84f02a6a31c144727d10af" .
5
- <http://bhuga.net/#ben> <http://xmlns.com/foaf/0.1/homepage> <http://bhuga.net/> .
6
- <http://bhuga.net/#ben> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bhuga/foaf> .
data/etc/bhuga.ttl DELETED
@@ -1,15 +0,0 @@
1
- @base <http://rubygems.org/gems/rdf> .
2
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
- @prefix dc: <http://purl.org/dc/terms/> .
5
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
6
- @prefix doap: <http://usefulinc.com/ns/doap#> .
7
- @prefix ex: <http://example.org/> .
8
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
-
10
- <http://bhuga.net/#ben> a foaf:Person ;
11
- foaf:name "Ben Lavender" ;
12
- foaf:mbox <mailto:blavender@gmail.com> ;
13
- foaf:mbox_sha1sum "dbf45f4ffbd27b67aa84f02a6a31c144727d10af" ;
14
- foaf:homepage <http://bhuga.net/> ;
15
- rdfs:isDefinedBy <http://datagraph.org/bhuga/foaf> .