tests/tc_xml_node.rb in libxml-ruby-0.5.1.0 vs tests/tc_xml_node.rb in libxml-ruby-0.5.2.0
- old
+ new
@@ -1,6 +1,6 @@
-# $Id: tc_xml_node.rb 67 2006-04-17 13:30:22Z roscopeco $
+# $Id: tc_xml_node.rb 191 2007-10-05 14:56:49Z danj $
require "libxml_test"
require 'test/unit'
class TC_XML_Node < Test::Unit::TestCase
def setup()
@@ -10,13 +10,14 @@
doc = xp.parse
assert_instance_of(XML::Document, doc)
@root = doc.root
assert_instance_of(XML::Node, @root)
set = doc.find('/ruby_array/fixnum')
- assert_instance_of(XML::Node::Set, set)
- xpt = set.xpath
- assert_instance_of(XML::XPath, xpt)
+ assert_instance_of(XML::XPath::Object, set)
+ assert_raise(NoMethodError) {
+ xpt = set.xpath
+ }
@nodes = []
set.each do |n|
@nodes.push(n)
end
end
@@ -48,10 +49,10 @@
assert_equal('element', @nodes[0].node_type_name)
assert_equal('element', @nodes[1].node_type_name)
end
def test_libxml_node_find()
- set = @root.find('./fixnum')
+ set = @root.find('./fixnum').set
assert_instance_of(XML::Node::Set, set)
for node in set
assert_instance_of(XML::Node, node)
end
end