test/xml/test_node.rb in nokogiri-maglev--1.5.3 vs test/xml/test_node.rb in nokogiri-maglev--1.5.4.20120815005250

- old
+ new

@@ -452,10 +452,15 @@ def test_at node = @xml.at('address') assert_equal node, @xml.xpath('//address').first end + def test_at_self + node = @xml.at('address') + assert_equal node, node.at('.') + end + def test_at_xpath node = @xml.at_xpath('//address') nodes = @xml.xpath('//address') assert_equal 5, nodes.size assert_equal node, nodes.first @@ -736,9 +741,14 @@ assert node = set.first assert parent_set = node.search('..') assert parent_node = parent_set.first assert_equal '/staff', parent_node.path assert_equal node.parent, parent_node + end + + def test_search_self + node = @xml.at('//employee') + assert_equal node.search('.').to_a, [node] end def test_search_by_symbol assert set = @xml.search(:employee) assert 5, set.length