pivotal/jasmine — pull request #298 by mattyod (2012-11-20 12:24:05+00:00)
Title: Added toBeNearTo() matcher

Matcher for numbers that are close to the actual or 'near enough'.

Accepts an expected result and a precision modifier.

i.e. .toBeNearTo(100, 2) would match 98, 99, 100, 101 & 102

This should perhaps be called toBeCloseTo(), and the existing method of that name might more accurately be called .toBePrecision() or some such but I'll leave that up to you.