Sha256: 7563f2a09c89016fe6d39ec0415b35dbcc470e708981657d63a85f9eb342c5cc

Contents?: true

Size: 507 Bytes

Versions: 22

Compression:

Stored size: 507 Bytes

Contents

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

class TestXpath < Minitest::Test
  def test_xpath
    doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE-NS.xml")
    doc.register_namespace 'des', 'http://example.org'
    doc.register_namespace 'ex', 'http://example1.org'

    assert(doc.find('//des:names').length == 1)
    nodesA = doc.root.find("des:names")
    assert(nodesA.length == 1)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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