|
27 | 27 | "application/rdf+xml" => RDF::Reader.for(:content_type => "application/rdf+xml"), |
28 | 28 | }.each_pair do |label, format| |
29 | 29 | it "should discover '#{label}'" do |
30 | | - format.should == RDF::RDFXML::Reader |
| 30 | + expect(format).to eq RDF::RDFXML::Reader |
31 | 31 | end |
32 | 32 | end |
33 | 33 | end |
|
52 | 52 |
|
53 | 53 | it "should yield reader" do |
54 | 54 | inner = double("inner") |
55 | | - inner.should_receive(:called).with(RDF::RDFXML::Reader) |
| 55 | + expect(inner).to receive(:called).with(RDF::RDFXML::Reader) |
56 | 56 | RDF::RDFXML::Reader.new(@sampledoc) do |reader| |
57 | 57 | inner.called(reader.class) |
58 | 58 | end |
59 | 59 | end |
60 | 60 |
|
61 | 61 | it "should return reader" do |
62 | | - RDF::RDFXML::Reader.new(@sampledoc).should be_a(RDF::RDFXML::Reader) |
| 62 | + expect(RDF::RDFXML::Reader.new(@sampledoc)).to be_a(RDF::RDFXML::Reader) |
63 | 63 | end |
64 | 64 |
|
65 | 65 | it "should yield statements" do |
66 | 66 | inner = double("inner") |
67 | | - inner.should_receive(:called).with(RDF::Statement).twice |
| 67 | + expect(inner).to receive(:called).with(RDF::Statement).twice |
68 | 68 | RDF::RDFXML::Reader.new(@sampledoc).each_statement do |statement| |
69 | 69 | inner.called(statement.class) |
70 | 70 | end |
71 | 71 | end |
72 | 72 |
|
73 | 73 | it "should yield triples" do |
74 | 74 | inner = double("inner") |
75 | | - inner.should_receive(:called).with(RDF::URI, RDF::URI, RDF::Literal).twice |
| 75 | + expect(inner).to receive(:called).with(RDF::URI, RDF::URI, RDF::Literal).twice |
76 | 76 | RDF::RDFXML::Reader.new(@sampledoc).each_triple do |subject, predicate, object| |
77 | 77 | inner.called(subject.class, predicate.class, object.class) |
78 | 78 | end |
|
88 | 88 | sampledoc = %(<?xml version="1.0" ?> |
89 | 89 | <NotRDF />) |
90 | 90 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
91 | | - graph.size.should == 1 |
| 91 | + expect(graph.size).to eq 1 |
92 | 92 | statement = graph.statements.first |
93 | | - statement.subject.class.should == RDF::Node |
94 | | - statement.predicate.should == RDF.type |
95 | | - statement.object.should == RDF::XML.NotRDF |
| 93 | + expect(statement.subject.class).to eq RDF::Node |
| 94 | + expect(statement.predicate).to eq RDF.type |
| 95 | + expect(statement.object).to eq RDF::XML.NotRDF |
96 | 96 | end |
97 | 97 |
|
98 | 98 | it "should parse on XML documents with multiple RDF nodes" do |
|
112 | 112 | </GenericXML>) |
113 | 113 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
114 | 114 | objects = graph.statements.map {|s| s.object.value}.sort |
115 | | - objects.should == ["Bar", "Foo"] |
| 115 | + expect(objects).to include("Bar", "Foo") |
116 | 116 | end |
117 | 117 |
|
118 | 118 | it "should be able to parse a simple single-triple document" do |
|
156 | 156 | <http://www.example.org/name> "Tom"@en] . |
157 | 157 | ) |
158 | 158 | graph = parse(sampledoc, :base_uri => "http://example.com/", :validate => true) |
159 | | - graph.should be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
| 159 | + expect(graph).to be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
160 | 160 | end |
161 | 161 |
|
162 | 162 | it "should be able to handle Bags/Alts etc." do |
|
168 | 168 | </rdf:Bag> |
169 | 169 | </rdf:RDF>) |
170 | 170 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
171 | | - graph.predicates.map(&:to_s).should include("http://www.w3.org/1999/02/22-rdf-syntax-ns#_1", "http://www.w3.org/1999/02/22-rdf-syntax-ns#_2") |
| 171 | + expect(graph.predicates.map(&:to_s)).to include("http://www.w3.org/1999/02/22-rdf-syntax-ns#_1", "http://www.w3.org/1999/02/22-rdf-syntax-ns#_2") |
172 | 172 | end |
173 | 173 | end |
174 | 174 |
|
|
199 | 199 | <http://example.net/> <http://purl.org/dc/terms/title> "Test 0304"@fr . |
200 | 200 | ) |
201 | 201 | graph = parse(svg, :base_uri => "http://example.com/", :validate => true) |
202 | | - graph.should be_equivalent_graph(expected, :trace => @debug) |
| 202 | + expect(graph).to be_equivalent_graph(expected, :trace => @debug) |
203 | 203 | end |
204 | 204 |
|
205 | 205 | context :exceptions do |
|
316 | 316 | ) |
317 | 317 |
|
318 | 318 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
319 | | - graph.should be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
| 319 | + expect(graph).to be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
320 | 320 | end |
321 | 321 | end |
322 | 322 |
|
|
343 | 343 | ) |
344 | 344 |
|
345 | 345 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
346 | | - graph.should be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
| 346 | + expect(graph).to be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
347 | 347 | end |
348 | 348 |
|
349 | 349 | it "decodes element content" do |
|
362 | 362 | ) |
363 | 363 |
|
364 | 364 | graph = parse(sampledoc, :base_uri => "http://example.com", :validate => true) |
365 | | - graph.should be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
| 365 | + expect(graph).to be_equivalent_graph(expected, :about => "http://example.com/", :trace => @debug) |
366 | 366 | end |
367 | 367 | end |
368 | 368 | end |
|
0 commit comments