bignum#to_f spec missing guards
Reported by James Deville | May 6th, 2008 @ 02:55 PM | in 1.0 preview
Bignum#to_f spec is testing string specific formatting that varies on Windows. The spec is testing that the to_f.to_s == "<>e+19", however on Windows, Ruby format's it as "<>e+019", thus the comparison fails. This spec should probably be guarded with platform specific tests.
Comments and changes to this ticket
-
Federico Builes May 7th, 2008 @ 08:32 AM
- → Assigned user changed from to Federico Builes
- → State changed from new to open
I'm attaching a patch that guards the specs. I don't have access to a Windows machine so please apply it and let me know if it works to push it.
-
Brian Ford May 7th, 2008 @ 10:11 AM
- → State changed from open to resolved
Alternative fix committed in d73b17b.
In general, we should use correct float literals for these specs. If there are cases where the number ends up being a non-terminating decimal, we should use the #be_close matcher with a suitable tolerance.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
