Skip to content
This repository

Failing tests for multi_xml 0.4.1 with ruby 1.9.3 #18

Closed
graaff opened this Issue December 22, 2011 · 2 comments

3 participants

Hans de Graaff Erik Michaels-Ober Vít Ondruch
Hans de Graaff

With ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] I'm getting three similar test failures:

  1) MultiXml LibXML parser it should behave like a parser.parse a valid XML document with an attribute type="decimal" should return the correct number
     Failure/Error: MultiXml.parse(@xml)['tag'].should == 3.14159265358979323846264338327950288419716939937510
       expected: 3.141592653589793
            got: #<BigDecimal:157b060,'0.3141592653 5897932384 6264338327 9502884197 1693993751E1',63(63)> (using ==)
     Shared Example Group: "a parser" called from ./spec/multi_xml_spec.rb:35


  2) MultiXml REXML parser it should behave like a parser.parse a valid XML document with an attribute type="decimal" should return the correct number
     Failure/Error: MultiXml.parse(@xml)['tag'].should == 3.14159265358979323846264338327950288419716939937510
       expected: 3.141592653589793
            got: #<BigDecimal:15d52b8,'0.3141592653 5897932384 6264338327 9502884197 1693993751E1',63(63)> (using ==)
     Shared Example Group: "a parser" called from ./spec/multi_xml_spec.rb:35

  3) MultiXml Nokogiri parser it should behave like a parser.parse a valid XML document with an attribute type="decimal" should return the correct number
     Failure/Error: MultiXml.parse(@xml)['tag'].should == 3.14159265358979323846264338327950288419716939937510
       expected: 3.141592653589793
            got: #<BigDecimal:6691f8,'0.3141592653 5897932384 6264338327 9502884197 1693993751E1',63(63)> (using ==)
     Shared Example Group: "a parser" called from ./spec/multi_xml_spec.rb:35
Hans de Graaff

It looks like ruby 1.9.3 doesn't make the long number a BigDecimal automatically. I've changed this locally to

BigDecimal.new('3.14159265358979323846264338327950288419716939937510')

which fixes things for ruby 1.8 and ruby 1.9.

Vít Ondruch
voxik commented March 06, 2012

Hm, it seems to be fixed by f06b89c, although I would say that it was committed by mistake and I don't like the solution

Erik Michaels-Ober sferik closed this August 05, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.