tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 195 forks source link

Added #approximately(value, delta, desc) for comparison of numbers within given precision #86

Closed titarenko closed 12 years ago

titarenko commented 12 years ago

It's quite handy to have something like this:

(3/4*Math.cos(0)).should.be.approximately(0.75, 1e-2);

But at the moment I haven't found such possibility in should.js. So, since I like this library and don't want to switch to another one, please, accept these changes and merge them into master to be released (I hope) soon.

faridnsh commented 12 years ago

Documentation should be added for this.