rdf-spec 1.99.0 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/{README → README.md} +2 -0
  3. data/VERSION +1 -1
  4. data/lib/rdf/spec.rb +18 -0
  5. data/lib/rdf/spec/countable.rb +5 -28
  6. data/lib/rdf/spec/dataset.rb +47 -0
  7. data/lib/rdf/spec/durable.rb +8 -23
  8. data/lib/rdf/spec/enumerable.rb +118 -102
  9. data/lib/rdf/spec/format.rb +4 -26
  10. data/lib/rdf/spec/http_adapter.rb +1 -23
  11. data/lib/rdf/spec/indexable.rb +1 -23
  12. data/lib/rdf/spec/inferable.rb +0 -16
  13. data/lib/rdf/spec/inspects.rb +4 -5
  14. data/lib/rdf/spec/matchers.rb +95 -4
  15. data/lib/rdf/spec/mutable.rb +227 -81
  16. data/lib/rdf/spec/queryable.rb +122 -165
  17. data/lib/rdf/spec/readable.rb +0 -22
  18. data/lib/rdf/spec/reader.rb +21 -29
  19. data/lib/rdf/spec/repository.rb +80 -40
  20. data/lib/rdf/spec/transactable.rb +43 -0
  21. data/lib/rdf/spec/transaction.rb +294 -71
  22. data/lib/rdf/spec/version.rb +2 -2
  23. data/lib/rdf/spec/writable.rb +78 -100
  24. data/lib/rdf/spec/writer.rb +51 -28
  25. data/spec/countable_spec.rb +11 -0
  26. data/spec/dataset_spec.rb +14 -0
  27. data/spec/durable_spec.rb +12 -0
  28. data/spec/enumerable_spec.rb +11 -0
  29. data/spec/format_spec.rb +12 -0
  30. data/spec/http_adapter_spec.rb +15 -0
  31. data/spec/indexable.rb +15 -0
  32. data/spec/literal_spec.rb +75 -0
  33. data/spec/mutable_spec.rb +11 -0
  34. data/spec/queryable_spec.rb +13 -0
  35. data/spec/readable.rb +11 -0
  36. data/spec/reader_spec.rb +17 -0
  37. data/spec/repository_spec.rb +11 -0
  38. data/spec/spec_helper.rb +13 -0
  39. data/spec/transaction_spec.rb +7 -0
  40. data/spec/version_spec.rb +2 -0
  41. data/spec/writable_spec.rb +13 -0
  42. data/spec/writer_spec.rb +11 -0
  43. metadata +56 -12
@@ -0,0 +1,75 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/literal'
3
+
4
+ describe RDF::Literal do
5
+ describe RDF::Literal::Boolean do
6
+ it_behaves_like 'RDF::Literal with datatype and grammar', "true", RDF::XSD.boolean
7
+ it_behaves_like 'RDF::Literal equality', "true", true
8
+ it_behaves_like 'RDF::Literal lexical values', "true"
9
+ it_behaves_like 'RDF::Literal canonicalization', RDF::XSD.boolean, [
10
+ %w(true true),
11
+ %w(false false),
12
+ %w(tRuE true),
13
+ %w(FaLsE false),
14
+ %w(1 true),
15
+ %w(0 false)
16
+ ]
17
+ it_behaves_like 'RDF::Literal validation', RDF::XSD.boolean,
18
+ %w(true false tRuE FaLsE 1 0),
19
+ %w(foo 10)
20
+ end
21
+
22
+ describe RDF::Literal::Integer do
23
+ it_behaves_like 'RDF::Literal with datatype and grammar', "1", RDF::XSD.integer
24
+ it_behaves_like 'RDF::Literal equality', "1", 1
25
+ it_behaves_like 'RDF::Literal lexical values', "1"
26
+ it_behaves_like 'RDF::Literal canonicalization', RDF::XSD.integer, [
27
+ %w(01 1),
28
+ %w(1 1),
29
+ %w(-1 -1),
30
+ %w(+1 1)
31
+ ]
32
+ it_behaves_like 'RDF::Literal validation', RDF::XSD.integer,
33
+ %w(1 10 100 01 +1 -1),
34
+ %w(foo 10.1 12xyz)
35
+ end
36
+
37
+ describe RDF::Literal::DateTime do
38
+ it_behaves_like 'RDF::Literal with datatype and grammar', "2010-01-01T00:00:00Z", RDF::XSD.dateTime
39
+ it_behaves_like 'RDF::Literal equality', "2010-01-01T00:00:00Z", DateTime.parse("2010-01-01T00:00:00Z")
40
+ it_behaves_like 'RDF::Literal lexical values', "2010-01-01T00:00:00Z"
41
+ it_behaves_like 'RDF::Literal canonicalization', RDF::XSD.dateTime, [
42
+ ["2010-01-01T00:00:00Z", "2010-01-01T00:00:00Z", "12:00:00 AM UTC on Friday, 01 January 2010"],
43
+ ["2010-01-01T00:00:00.0000Z", "2010-01-01T00:00:00Z", "12:00:00 AM UTC on Friday, 01 January 2010"],
44
+ ["2010-01-01T00:00:00", "2010-01-01T00:00:00", "12:00:00 AM on Friday, 01 January 2010"],
45
+ ["2010-01-01T00:00:00+00:00", "2010-01-01T00:00:00Z", "12:00:00 AM UTC on Friday, 01 January 2010"],
46
+ ["2010-01-01T01:00:00+01:00", "2010-01-01T00:00:00Z", "01:00:00 AM +01:00 on Friday, 01 January 2010"],
47
+ ["2009-12-31T23:00:00-01:00", "2010-01-01T00:00:00Z", "11:00:00 PM -01:00 on Thursday, 31 December 2009"],
48
+ ["-2010-01-01T00:00:00Z", "-2010-01-01T00:00:00Z","12:00:00 AM UTC on Friday, 01 January -2010"],
49
+ #["2014-09-01T12:13:14.567", "2014-09-01T12:13:14", "12:13:14 PM on Monday, 01 September 2014"],
50
+ #["2014-09-01T12:13:14.567Z", "2014-09-01T12:13:14Z", "12:13:14 PM UTC on Monday, 01 September 2014"],
51
+ #["2014-09-01T12:13:14.567-08:00","2014-09-01T20:13:14Z","12:13:14 PM -08:00 on Monday, 01 September 2014"],
52
+ ]
53
+ it_behaves_like 'RDF::Literal validation', RDF::XSD.dateTime,
54
+ %w(
55
+ 2010-01-01T00:00:00Z
56
+ 2010-01-01T00:00:00.0000Z
57
+ 2010-01-01T00:00:00
58
+ 2010-01-01T00:00:00+00:00
59
+ 2010-01-01T01:00:00+01:00
60
+ 2009-12-31T23:00:00-01:00
61
+ -2010-01-01T00:00:00Z
62
+ ),
63
+ %w(
64
+ foo
65
+ +2010-01-01T00:00:00Z
66
+ 2010-01-01T00:00:00FOO
67
+ 02010-01-01T00:00:00
68
+ 2010-01-01
69
+ 2010-1-1T00:00:00
70
+ 0000-01-01T00:00:00
71
+ 2010-07
72
+ 2010
73
+ )
74
+ end
75
+ end
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/mutable'
3
+
4
+ describe RDF::Mutable do
5
+ # @see lib/rdf/spec/mutable.rb in rdf-spec
6
+ it_behaves_like 'an RDF::Mutable' do
7
+ # The available reference implementations are `RDF::Repository` and
8
+ # `RDF::Graph`
9
+ let(:mutable) { RDF::Repository.new }
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/queryable'
3
+
4
+ describe RDF::Queryable do
5
+ # @see lib/rdf/spec/queryable.rb in rdf-spec
6
+ it_behaves_like 'an RDF::Queryable' do
7
+ # The available reference implementations are `RDF::Repository` and
8
+ # `RDF::Graph`, but a subclass of Ruby Array implementing
9
+ # `query_pattern` and `query_execute` should do as well
10
+ # FIXME
11
+ let(:queryable) { RDF::Repository.new }
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/readable'
3
+
4
+ describe RDF::Readable do
5
+ # @see lib/rdf/spec/readable.rb in rdf-spec
6
+ it_behaves_like 'an RDF::Readable' do
7
+ # The available reference implementations are `RDF::Repository` and
8
+ # `RDF::Graph`, but a plain Ruby array will do fine as well:
9
+ let(:readable) { double("Readable").extend(RDF::Readable) }
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.join(File.dirname(__FILE__), 'spec_helper')
3
+ require 'rdf/ntriples'
4
+ require 'rdf/spec/reader'
5
+
6
+ describe RDF::NTriples::Reader do
7
+ let!(:doap) {File.expand_path("../../etc/doap.nt", __FILE__)}
8
+ let!(:doap_count) {File.open(doap).each_line.to_a.length}
9
+ subject { RDF::NTriples::Reader.new }
10
+
11
+ # @see lib/rdf/spec/reader.rb in rdf-spec
12
+ it_behaves_like 'an RDF::Reader' do
13
+ let(:reader) { RDF::NTriples::Reader.new }
14
+ let(:reader_input) { File.read(doap) }
15
+ let(:reader_count) { doap_count }
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/repository'
3
+
4
+ describe RDF::Repository do
5
+ # @see lib/rdf/spec/repository.rb in rdf-spec
6
+ it_behaves_like 'an RDF::Repository' do
7
+ # The available reference implementations are `RDF::Repository` and
8
+ # `RDF::Graph`, but a plain Ruby array will do fine as well:
9
+ let(:repository) { RDF::Repository.new }
10
+ end
11
+ end
@@ -1,5 +1,18 @@
1
1
  require "bundler/setup"
2
2
  require 'rdf'
3
+ begin
4
+ require 'simplecov'
5
+ require 'coveralls'
6
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
7
+ SimpleCov::Formatter::HTMLFormatter,
8
+ Coveralls::SimpleCov::Formatter
9
+ ])
10
+ SimpleCov.start do
11
+ add_filter "matchers.rb"
12
+ add_filter "inspects.rb"
13
+ end
14
+ rescue LoadError
15
+ end
3
16
  require 'rdf/spec'
4
17
  require 'rdf/spec/matchers'
5
18
 
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/transaction'
3
+
4
+ describe RDF::Transaction, skip: "pending fixes to immutability errors" do
5
+ # @see lib/rdf/spec/transaction.rb in rdf-spec
6
+ it_behaves_like "an RDF::Transaction", RDF::Transaction
7
+ end
@@ -3,5 +3,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
3
3
  describe 'RDF::Spec::VERSION' do
4
4
  it "is_expected.to match the VERSION file" do
5
5
  expect(RDF::Spec::VERSION.to_s).to eq File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')).chomp
6
+ expect(RDF::Spec::VERSION.to_str).to eq File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')).chomp
7
+ expect(RDF::Spec::VERSION.to_a).to eq RDF::Spec::VERSION.to_s.split('.')
6
8
  end
7
9
  end
@@ -0,0 +1,13 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ require 'rdf/spec/writable'
3
+
4
+ describe RDF::Writable do
5
+ subject {RDF::Repository.new}
6
+
7
+ # @see lib/rdf/spec/writable.rb in rdf-spec
8
+ it_behaves_like 'an RDF::Writable' do
9
+ # The available reference implementations are `RDF::Repository` and
10
+ # `RDF::Graph`, but a plain Ruby array will do fine as well:
11
+ let(:writable) { RDF::Repository.new }
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.join(File.dirname(__FILE__), 'spec_helper')
3
+ require 'rdf/ntriples'
4
+ require 'rdf/spec/writer'
5
+
6
+ describe RDF::NTriples::Writer do
7
+ # @see lib/rdf/spec/writer.rb in rdf-spec
8
+ it_behaves_like 'an RDF::Writer' do
9
+ let(:writer) { RDF::NTriples::Writer.new }
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.0
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -10,22 +10,48 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-30 00:00:00.000000000 Z
13
+ date: 2016-02-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdf
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0.beta
22
+ - - "<"
20
23
  - !ruby/object:Gem::Version
21
- version: '1.99'
24
+ version: '3'
22
25
  type: :runtime
23
26
  prerelease: false
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
- - - "~>"
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 2.0.0.beta
32
+ - - "<"
33
+ - !ruby/object:Gem::Version
34
+ version: '3'
35
+ - !ruby/object:Gem::Dependency
36
+ name: rdf-isomorphic
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
27
40
  - !ruby/object:Gem::Version
28
- version: '1.99'
41
+ version: 2.0.0.beta
42
+ - - "<"
43
+ - !ruby/object:Gem::Version
44
+ version: '3'
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 2.0.0.beta
52
+ - - "<"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
29
55
  - !ruby/object:Gem::Dependency
30
56
  name: rspec
31
57
  requirement: !ruby/object:Gem::Requirement
@@ -91,7 +117,7 @@ extra_rdoc_files: []
91
117
  files:
92
118
  - AUTHORS
93
119
  - CREDITS
94
- - README
120
+ - README.md
95
121
  - UNLICENSE
96
122
  - VERSION
97
123
  - etc/bendiken.nq
@@ -103,6 +129,7 @@ files:
103
129
  - etc/triples.nt
104
130
  - lib/rdf/spec.rb
105
131
  - lib/rdf/spec/countable.rb
132
+ - lib/rdf/spec/dataset.rb
106
133
  - lib/rdf/spec/durable.rb
107
134
  - lib/rdf/spec/enumerable.rb
108
135
  - lib/rdf/spec/format.rb
@@ -117,15 +144,32 @@ files:
117
144
  - lib/rdf/spec/readable.rb
118
145
  - lib/rdf/spec/reader.rb
119
146
  - lib/rdf/spec/repository.rb
147
+ - lib/rdf/spec/transactable.rb
120
148
  - lib/rdf/spec/transaction.rb
121
149
  - lib/rdf/spec/version.rb
122
150
  - lib/rdf/spec/writable.rb
123
151
  - lib/rdf/spec/writer.rb
152
+ - spec/countable_spec.rb
153
+ - spec/dataset_spec.rb
154
+ - spec/durable_spec.rb
155
+ - spec/enumerable_spec.rb
156
+ - spec/format_spec.rb
157
+ - spec/http_adapter_spec.rb
158
+ - spec/indexable.rb
159
+ - spec/literal_spec.rb
160
+ - spec/mutable_spec.rb
161
+ - spec/queryable_spec.rb
162
+ - spec/readable.rb
163
+ - spec/reader_spec.rb
164
+ - spec/repository_spec.rb
124
165
  - spec/spec_helper.rb
166
+ - spec/transaction_spec.rb
125
167
  - spec/version_spec.rb
168
+ - spec/writable_spec.rb
169
+ - spec/writer_spec.rb
126
170
  homepage: http://ruby-rdf.github.com/rdf-spec/
127
171
  licenses:
128
- - Public Domain
172
+ - Unlicense
129
173
  metadata: {}
130
174
  post_install_message:
131
175
  rdoc_options: []
@@ -135,15 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
179
  requirements:
136
180
  - - ">="
137
181
  - !ruby/object:Gem::Version
138
- version: 1.9.2
182
+ version: '2.0'
139
183
  required_rubygems_version: !ruby/object:Gem::Requirement
140
184
  requirements:
141
- - - ">="
185
+ - - ">"
142
186
  - !ruby/object:Gem::Version
143
- version: '0'
187
+ version: 1.3.1
144
188
  requirements: []
145
189
  rubyforge_project: rdf
146
- rubygems_version: 2.4.5.1
190
+ rubygems_version: 2.5.1
147
191
  signing_key:
148
192
  specification_version: 4
149
193
  summary: RSpec extensions for RDF.rb.