From 3583fa166c52aff1ac6fab310e9133c553efcc4a Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Mon, 31 Dec 2018 07:21:37 +0900 Subject: [ruby/rexml] xpath: fix a bug that no namespace attribute isn't matched with prefix [ruby-list:50733] Reported by Yasuhiro KIMURA. Thanks!!! https://github.com/ruby/rexml/commit/8f3c5c176a --- test/rexml/xpath/test_attribute.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/rexml/xpath') 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 - + child1 child2 child3 @@ -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 -- cgit v1.2.3