|
309 | 309 | end |
310 | 310 | end |
311 | 311 |
|
312 | | - context 'parse language/direction' do |
313 | | - { |
314 | | - "language" => '<http://subj> <http://pred> "Hello"@en .', |
315 | | - "direction" => '<http://subj> <http://pred> "Hello"@en--ltr .', |
316 | | - }.each_pair do |name, triple| |
317 | | - specify "test #{name}" do |
318 | | - stmt = reader.new(triple).first |
319 | | - if name.include?('dir') |
320 | | - expect(stmt.object.datatype).to eql RDF.dirLangString |
321 | | - else |
322 | | - expect(stmt.object.datatype).to eql RDF.langString |
| 312 | + context "base direction" do |
| 313 | + context "without rdfstar option" do |
| 314 | + it "Raises an error" do |
| 315 | + expect do |
| 316 | + expect {parse('<http://subj> <http://pred> "Hello"@en--ltr .')}.to raise_error(RDF::ReaderError) |
| 317 | + end.to write(:something).to(:error) |
| 318 | + end |
| 319 | + end |
| 320 | + |
| 321 | + context 'parse language/direction' do |
| 322 | + { |
| 323 | + "language" => '<http://subj> <http://pred> "Hello"@en .', |
| 324 | + "direction" => '<http://subj> <http://pred> "Hello"@en--ltr .', |
| 325 | + }.each_pair do |name, triple| |
| 326 | + specify "test #{name}" do |
| 327 | + stmt = reader.new(triple, rdfstar: true).first |
| 328 | + if name.include?('dir') |
| 329 | + expect(stmt.object.datatype).to eql RDF.dirLangString |
| 330 | + else |
| 331 | + expect(stmt.object.datatype).to eql RDF.langString |
| 332 | + end |
323 | 333 | end |
324 | 334 | end |
325 | 335 | end |
|
370 | 380 |
|
371 | 381 | "Literals with languages (1)" => '<http://example.org/resource30> <http://example.org/property> "chat"@fr .', |
372 | 382 | "Literals with languages (2)" => '<http://example.org/resource31> <http://example.org/property> "chat"@en .', |
| 383 | + # FIXME: once rdfstar option is no longer used |
373 | 384 | #"Literals with language and direction" => '<http://example.org/resource31> <http://example.org/property> "chat"@en--ltr .', |
374 | 385 | "Typed Literals" => '<http://example.org/resource32> <http://example.org/property> "abc"^^<http://example.org/datatype1> .', |
375 | 386 | "Plain lieral with embedded quote" => %q(<http://example.org/resource33> <http://example.org/property> "From \\"Voyage dans l’intérieur de l’Amérique du Nord, executé pendant les années 1832, 1833 et 1834, par le prince Maximilien de Wied-Neuwied\\" (Paris & Coblenz, 1839-1843)" .), |
|
0 commit comments