5 def initialize(expected, delta)
12 (@actual - @expected).abs < @delta
16 "expected #{@expected} +/- (< #{@delta}), got #{@actual}"
20 "be close to #{@expected} (within +- #{@delta})"
25 # should be_close(expected, delta)
26 # should_not be_close(expected, delta)
28 # Passes if actual == expected +/- delta
32 # result.should be_close(3.0, 0.5)
33 def be_close(expected, delta)
34 Matchers::BeClose.new(expected, delta)