diff --git a/lib/equivalent-xml.rb b/lib/equivalent-xml.rb index 592dbf9..52ddb0a 100644 --- a/lib/equivalent-xml.rb +++ b/lib/equivalent-xml.rb @@ -185,7 +185,7 @@ def ignore_content?(node, opts = {}) return false if ignore_list.empty? ignore_list.each do |selector| - return true if node.document.css(selector).include?(node) + return true if node.document.search(selector).include?(node) end return false diff --git a/spec/equivalent-xml_spec.rb b/spec/equivalent-xml_spec.rb index 613621c..ff2563b 100644 --- a/spec/equivalent-xml_spec.rb +++ b/spec/equivalent-xml_spec.rb @@ -197,6 +197,12 @@ doc1.should be_equivalent_to(doc2).ignoring_content_of("SerialNumber") end + + it "is able to ignore nodes with xmlns attribute set" do + doc1 = Nokogiri::XML('') + doc2 = Nokogiri::XML('') + doc1.should be_equivalent_to(doc2).ignoring_content_of("//a") + end end context "with the :ignore_content_paths option set to an array of CSS selectors" do