sconover / wrong

Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
MIT License
434 stars 31 forks source link

Include Wrong::CloseTo in Numeric so it works for all Numerics #4

Closed ahx closed 13 years ago

ahx commented 13 years ago

Hi

i came across one situation when JRuby was behaving a little different than MRI and gave me a BigDecimal where MRI used to return a Float. It did not really matter for the project, but using Wrong::CloseTo in my assertion did not work, because only Float and Fixnum could respond to 'close_to?'.

So here's a tiny fix for that, just including CloseTo in Numeric. Love the name, 'wrong'.

sconover commented 13 years ago

Thanks a lot for this fix! And for the tweet.

Merged and pushed.