Sha256: 93b9c8e0a9293a839c1d85b00e0eb81c08fd32a123eef4792c7c4d6b936302c8
Contents?: true
Size: 999 Bytes
Versions: 22
Compression:
Stored size: 999 Bytes
Contents
require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart') require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb') class TestXpathRoot < Minitest::Test def test_xpath_root doc = XML::Smart.open(::File.dirname(__FILE__) + "/EXAMPLE.xml") nodes = doc.find("//*/text()") assert(nodes[0].path == "/test/names/name[1]/text()") assert(nodes[1].path == "/test/names/name[2]/text()") assert(nodes[2].path == "/test/names/name[3]/text()") assert(nodes[3].path == "/test/names/name[4]/text()") assert(nodes[4].path == "/test/names/name[5]/text()") assert(nodes[5].path == "/test/names/name[5]/b/text()") assert(nodes[6].path == "/test/names/name[6]/text()") assert(nodes[7].path == "/test/names/test_node/text()[1]") assert(nodes[8].path == "/test/names/test_node/text()[2]") assert(nodes[9].path == "/test/names/test_node/text()[3]") assert(nodes[10].path == "/test/colors/blue/text()") assert(nodes[11].nil?) end end
Version data entries
22 entries across 22 versions & 1 rubygems