test/xml_test.rb in iq_rdf-0.1.2 vs test/xml_test.rb in iq_rdf-0.1.3
- old
+ new
@@ -15,11 +15,11 @@
$LOAD_PATH << File.dirname(__FILE__)
require 'test_helper'
class XmlTest < Test::Unit::TestCase
-
+
def test_basic_xml_output
document = IqRdf::Document.new('http://www.test.de/', :lang => :de)
document.namespaces :foaf => 'http://xmlns.com/foaf/0.1/'
document << IqRdf::testemann do |t|
@@ -66,11 +66,11 @@
document = IqRdf::Document.new('http://www.umweltprobenbank.de/', :lang => :de)
document.namespaces :skos => 'http://www.w3.org/2008/05/skos#', :foaf => 'http://xmlns.com/foaf/0.1/', :upb => 'http://www.upb.de/'
document << IqRdf::testemann.myCustomNote("This is an example", :lang => :en) # :testemann :myCustomNote "This is an example"@en.
-
+
document << IqRdf::testemann(IqRdf::Foaf::build_uri("Person")).Foaf::name("Heinz Peter Testemann", :lang => :none) # :testemann a foaf:Person; foaf:name "Heinz Peter Testemann" .
document << IqRdf::testemann.Foaf::knows(IqRdf::testefrau) # :testemann foaf:knows :testefrau .
document << IqRdf::testemann.Foaf::nick("Crash test dummy") # :testemann foaf:nick "Crash test dummy"@de .
document << IqRdf::testemann.testIt([IqRdf::hello, "bla"]) # :testIt (:hallo :goodbye "bla"@de), "blubb"@de; # XML: rdf:list
@@ -176,10 +176,11 @@
t.Foaf.nick("Testy")
t.Foaf.lastname("Testemann", :lang => :none)
t.age(32)
t.married(false)
t.weight(65.8)
+ t.complex(IqRdf::Literal.new("A very complex type", :none, URI.parse("http://this.com/is#complex")))
t.quotes("\"I'm \\quoted\"")
t.line_breaks("I'm written\nover two lines")
t.some_literal(IqRdf::Literal.new("text", :de))
end
@@ -191,10 +192,11 @@
<foaf:nick>Testy</foaf:nick>
<foaf:lastname xml:lang="">Testemann</foaf:lastname>
<age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">32</age>
<married rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</married>
<weight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">65.8</weight>
+ <complex rdf:datatype="http://this.com/is#complex" xml:lang="none">A very complex type</complex>
<quotes>"I'm \\quoted"</quotes>
<line_breaks>I'm written
over two lines</line_breaks>
<some_literal xml:lang="de">text</some_literal>
</rdf:Description>
@@ -230,6 +232,6 @@
</rdf:Description>
</rdf:RDF>
rdf
end
- end
\ No newline at end of file
+ end