diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rexml/xpath/test_attribute.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/rexml/xpath/test_attribute.rb b/test/rexml/xpath/test_attribute.rb index 9304db4e0d..713d77b22f 100644 --- a/test/rexml/xpath/test_attribute.rb +++ b/test/rexml/xpath/test_attribute.rb @@ -7,7 +7,7 @@ module REXMLTests def setup @xml = <<-XML <?xml version="1.0" encoding="UTF-8"?> -<root> +<root xmlns="http://example.com/"> <child name="one">child1</child> <child name="two">child2</child> <child name="three">child3</child> @@ -26,5 +26,13 @@ module REXMLTests children = REXML::XPath.each(@document, "/root/child[@name='two']") assert_equal(["child2"], children.collect(&:text)) end + + def test_no_namespace + children = REXML::XPath.match(@document, + "/root/child[@nothing:name='two']", + "" => "http://example.com/", + "nothing" => "") + assert_equal(["child2"], children.collect(&:text)) + end end end |