Method: MiniTest::Assertions#refute_in_delta
- Defined in:
- lib/minitest/unit.rb
#refute_in_delta(exp, act, delta = 0.001, msg = nil) ⇒ Object
For comparing Floats. Fails if exp
is within delta
of act
refute_in_delta Math::PI, (22.0 / 7.0)
410 411 412 413 414 415 416 |
# File 'lib/minitest/unit.rb', line 410 def refute_in_delta exp, act, delta = 0.001, msg = nil n = (exp - act).abs msg = (msg) { "Expected #{exp} - #{act} (#{n}) to not be < #{delta}" } refute delta > n, msg end |