#535 √ resolved
James Deville

bignum#to_f spec missing guards

Reported by James Deville | May 6th, 2008 @ 11: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

    Federico Builes May 7th, 2008 @ 05:32 PM

      • → State changed from “new” to “open”
      • → Assigned user changed from “” to “Federico Builes”

    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

    Brian Ford May 7th, 2008 @ 07:11 PM

      • → 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 »

Attachments

People watching this ticket

Tags