diff options
Diffstat (limited to 'spec/mspec/spec/matchers/be_close_spec.rb')
-rw-r--r-- | spec/mspec/spec/matchers/be_close_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/mspec/spec/matchers/be_close_spec.rb b/spec/mspec/spec/matchers/be_close_spec.rb index 9b6e56e6d5..6edff98e4a 100644 --- a/spec/mspec/spec/matchers/be_close_spec.rb +++ b/spec/mspec/spec/matchers/be_close_spec.rb @@ -16,12 +16,14 @@ describe BeCloseMatcher do BeCloseMatcher.new(5.0, 0.5).matches?(4.51).should == true end - it "does not match when actual == (expected + tolerance)" do - BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == false + it "matches when actual == (expected + tolerance)" do + BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == true + BeCloseMatcher.new(3, 2).matches?(5).should == true end - it "does not match when actual == (expected - tolerance)" do - BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == false + it "matches when actual == (expected - tolerance)" do + BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == true + BeCloseMatcher.new(3, 2).matches?(1).should == true end it "does not match when actual < (expected - tolerance)" do |