equivalent-xml gem
wmene opened this issue · comments
wmene commented
Awesome gem to check equivalency between xml documents or nodes. Has built in Rspec matchers so you can write specs like this:
expect(node_1).to be_equivalent_to(node_2)
lorien commented
How could it be useful in web scraping process?
wmene commented
It could be used to compare xml documents without regards to element or attribute order, similar to what the JsonCompare gem you list does for Json. Here's an example:
require 'equivalent-xml'
xml1 = '<a><b/><c/></a>'
xml2 = '<a><b/><c/></a>'
EquivalentXml.equivalent? xml1, xml2
=> true
lorien commented
OK, I've added it. Thank you :)