require 'test/unit' require 'approximately_equals' class TC_approximately_equals < Test::Unit::TestCase def test_approximately_equals assert(!(1 =~ 1.001)) assert(1 =~ 1.000000000000001) assert(1.approximately_equals?(1.001,0.01)) Numeric.epsilon = 0.01 assert(1 =~ 1.001) end end