Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/equivalent-xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spec/equivalent-xml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('<a xmlns=""></a>')
doc2 = Nokogiri::XML('<a xmlns=""></a>')
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
Expand Down