Sha256: 87b5a630bf35c7e7faa8c00349b9fbf60ba2784ec28cce31b1d0f34ae600d21b

Contents?: true

Size: 994 Bytes

Versions: 22

Compression:

Stored size: 994 Bytes

Contents

require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart')
require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb')

class TestQname < Minitest::Test
  def test_qname
    doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE.xml")
    doc.register_namespace("s","http://schemas.xmlsoap.org/wsdl/soap/")

    node = doc.root.find("/test/s:hallo").first
    assert(!node.nil?)
    assert(node.qname == "hallo")
    assert(node.qname.name == 'hallo')
    assert(node.qname.prefix == 'soap')
    assert(node.namespace.instance_of? XML::Smart::Dom::Namespace)
    assert(node.qname.to_s == 'soap:hallo')
    assert(node.qname.instance_of? XML::Smart::QName)

    node = doc.root.find("/test").first
    assert(node.qname.to_s == 'test')

    doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE-NS.xml")

    node = doc.root.find("/xmlns0:test").first
    assert(!node.nil?)
    assert(node.qname == "test")
    assert(node.qname.to_s == "test")
  end  
end  

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
xml-smart-0.5.3 test/tc_qname.rb
xml-smart-0.5.2 test/tc_qname.rb
xml-smart-0.5.1 test/tc_qname.rb
xml-smart-0.5.0 test/tc_qname.rb
xml-smart-0.4.4 test/tc_qname.rb
xml-smart-0.4.3 test/tc_qname.rb
xml-smart-0.4.2 test/tc_qname.rb
xml-smart-0.4.1 test/tc_qname.rb
xml-smart-0.4.0 test/tc_qname.rb
xml-smart-0.3.22 test/tc_qname.rb
xml-smart-0.3.21 test/tc_qname.rb
xml-smart-0.3.20 test/tc_qname.rb
xml-smart-0.3.19 test/tc_qname.rb
xml-smart-0.3.18 test/tc_qname.rb
xml-smart-0.3.17 test/tc_qname.rb
xml-smart-0.3.16 test/tc_qname.rb
xml-smart-0.3.15 test/tc_qname.rb
xml-smart-0.3.14 test/tc_qname.rb
xml-smart-0.3.12 test/tc_qname.rb
xml-smart-0.3.11 test/tc_qname.rb