summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2013-06-14 21:49:56 +0800
committerDaniel Bovensiepen <[email protected]>2013-06-14 21:49:56 +0800
commit60d230d0fdf9a6e22ae13f30cb11f4c948c1d62b (patch)
tree12cd7b1cbc8078abdda1805f77275c47d43bc3f0
parentbbdc24f2eeee1517f6a806f00a091ef46f692a19 (diff)
downloadmruby-60d230d0fdf9a6e22ae13f30cb11f4c948c1d62b.tar.gz
mruby-60d230d0fdf9a6e22ae13f30cb11f4c948c1d62b.zip
Add assert_float to test environment
-rw-r--r--test/assert.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/assert.rb b/test/assert.rb
index f7c2c97b9..38141d1e8 100644
--- a/test/assert.rb
+++ b/test/assert.rb
@@ -179,6 +179,14 @@ def assert_kind_of(cls, obj, msg = nil)
end
##
+# Fails unless +exp+ is equal to +act+ in terms of a Float
+def assert_float(exp, act, msg = nil)
+ msg = "Float #{exp} expected to be equal to float #{act}" unless msg
+ diff = assertion_diff(exp, act)
+ assert_true check_float(exp, act), msg, diff
+end
+
+##
# Report the test result and print all assertions
# which were reported broken.
def report()