It now calculates and compares a difference, rather than rounding
two separate quantities and testing for their equality.
This fixes the problem where:
expect(1.225).toBeCloseTo(1.234); // difference is 0.009, and it passes
expect(1.225).toBeCloseTo(1.224); // difference is 0.001, but it fails
All the existing specs still pass; I've just added two examples like the above, with the first negated.
Change toBeCloseTo matcher to be more consistent.
Thanks for finding this. And thanks for using Jasmine!
Thanks for writing it, and for merging my change! It caused me a bit of grief.
(I think an even better version would have an absolute (rather than logarithmic) second argument, like RSpec's version, like this: expect(1.23).toBeCloseTo(1.234, 0.1) -- but that would probably not be backwards-compatible -- although you could use that rule only for fractional arguments...)