summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/matchers/infinity_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/matchers/infinity_spec.rb')
-rw-r--r--spec/mspec/spec/matchers/infinity_spec.rb18
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