equivalent-xml
equivalent-xml copied to clipboard
Easy equivalency tests for Nokogiri and Oga XML
When I compare two nodes which have set "xmlns" attribute, and ignoring them, they should be equal.
With this change you will get next to expected: ..., got: ... also message: Hash.inspect This way you can see what was wrong in you comparison. Hope you like it...
While working on https://github.com/bootstrap-ruby/rails-bootstrap-forms/pull/278, I found that excluding attributes with dashes does not work.
I ran into an issue attempting to use the master version (which fixes a comparison bug we were having in 0.6.0) where the order of files being loaded in `lib/equivalent-xml.rb`...
Dependencies aren't compatible anymore on half of the build environments, e.g.: ``` NoMethodError: undefined method `last_comment' for # /home/travis/.rvm/gems/ruby-2.3.0/gems/rspec-core-2.99.2/lib/rspec/core/rake_task.rb:143:in `initialize' /home/travis/build/mbklein/equivalent-xml/Rakefile:17:in `new' /home/travis/build/mbklein/equivalent-xml/Rakefile:17:in `' /home/travis/.rvm/gems/ruby-2.3.0/gems/rake-12.3.0/exe/rake:27:in `' /home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval' /home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `'...
First up, thanks for this gem! It is exactly what I need for testing some XML output and is vastly simplifying a lot of code I wrote. Thank you! One...
It would be nice that: ```ruby EquivalentXml.equivalent? Nokogiri::HTML::DocumentFragment.parse(''), Nokogiri::HTML::DocumentFragment.parse('') ``` gives `true` and not `false`
I think it would be useful, to have something like `expect(xml).to contain_xml("bar")`. With this, you would be able to match a partial xml to a parent document.
equivalent-xml ignores unescaped XML entities. Try with this spec: ``` ruby it "should detect xml entities" do doc1 = "Sam & Maxthings" doc2 = "Sam Maxthings" expect(doc1).not_to be_equivalent_to(doc2) end ```...
Hi, I found an issue when comparing Strings with NodeLists like "<h1>Headline</h1><h1>Headline</h1>" and "<h1>Headline</h1><h2>Headline2</h2>". Everything after the first tag got ignored. The new spec (in this patch) demonstrates the issue....