test/test_helper.rb in unitwise-0.6.2 vs test/test_helper.rb in unitwise-0.7.0
- old
+ new
@@ -4,6 +4,16 @@
end
require 'minitest/autorun'
require 'minitest/pride'
-require 'unitwise'
\ No newline at end of file
+require 'unitwise'
+
+module Minitest::Assertions
+ def assert_almost_equal(expected, actual)
+ message = "Expected #{actual} to be almost equal to #{expected}"
+ range = 0.00001
+ assert expected + range > actual && expected - range < actual, message
+ end
+end
+
+Numeric.infect_an_assertion :assert_almost_equal, :must_almost_equal