Object
# File lib/rspec/matchers/built_in/be_within.rb, line 33 def description "be within #{delta} of #{expected}" end
# File lib/rspec/matchers/built_in/be_within.rb, line 25 def failure_message_for_should "expected #{actual} to #{description}" end
# File lib/rspec/matchers/built_in/be_within.rb, line 29 def failure_message_for_should_not "expected #{actual} not to #{description}" end
# File lib/rspec/matchers/built_in/be_within.rb, line 13 def matches?(actual) unless defined?(@expected) raise ArgumentError.new("You must set an expected value using #of: be_within(#{delta}).of(expected_value)") end (super(actual) - expected).abs <= delta end
Generated with the Darkfish Rdoc Generator 2.