diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-03-27 13:02:38 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-03-27 13:02:38 +0100 |
commit | 44736a6b7a2b3475db2d05187f33e3c1a7b4b4e5 (patch) | |
tree | 4cb679a8742121782a50e72e01160d19f479f9a6 /spec/mspec/spec/matchers/infinity_spec.rb | |
parent | 31ae931e166825450dcc16d470553e67281951a2 (diff) |
Update to ruby/mspec@d1adf59
Diffstat (limited to 'spec/mspec/spec/matchers/infinity_spec.rb')
-rw-r--r-- | spec/mspec/spec/matchers/infinity_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/mspec/spec/matchers/infinity_spec.rb b/spec/mspec/spec/matchers/infinity_spec.rb index 6eb8ac2940..78c4194526 100644 --- a/spec/mspec/spec/matchers/infinity_spec.rb +++ b/spec/mspec/spec/matchers/infinity_spec.rb @@ -4,31 +4,31 @@ require 'mspec/guards' require 'mspec/helpers' require 'mspec/matchers' -describe InfinityMatcher do +RSpec.describe InfinityMatcher do it "matches when actual is infinite and has the correct sign" do - InfinityMatcher.new(1).matches?(infinity_value).should == true - InfinityMatcher.new(-1).matches?(-infinity_value).should == true + expect(InfinityMatcher.new(1).matches?(infinity_value)).to eq(true) + expect(InfinityMatcher.new(-1).matches?(-infinity_value)).to eq(true) end it "does not match when actual is not infinite" do - InfinityMatcher.new(1).matches?(1.0).should == false - InfinityMatcher.new(-1).matches?(-1.0).should == false + expect(InfinityMatcher.new(1).matches?(1.0)).to eq(false) + expect(InfinityMatcher.new(-1).matches?(-1.0)).to eq(false) end it "does not match when actual is infinite but has the incorrect sign" do - InfinityMatcher.new(1).matches?(-infinity_value).should == false - InfinityMatcher.new(-1).matches?(infinity_value).should == false + expect(InfinityMatcher.new(1).matches?(-infinity_value)).to eq(false) + expect(InfinityMatcher.new(-1).matches?(infinity_value)).to eq(false) end it "provides a useful failure message" do matcher = InfinityMatcher.new(-1) matcher.matches?(0) - matcher.failure_message.should == ["Expected 0", "to be -Infinity"] + expect(matcher.failure_message).to eq(["Expected 0", "to be -Infinity"]) end it "provides a useful negative failure message" do matcher = InfinityMatcher.new(1) matcher.matches?(infinity_value) - matcher.negative_failure_message.should == ["Expected Infinity", "not to be Infinity"] + expect(matcher.negative_failure_message).to eq(["Expected Infinity", "not to be Infinity"]) end end |