summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/matchers/respond_to_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/matchers/respond_to_spec.rb')
-rw-r--r--spec/mspec/spec/matchers/respond_to_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/mspec/spec/matchers/respond_to_spec.rb b/spec/mspec/spec/matchers/respond_to_spec.rb
index 988caf4dff..6f1cd8d148 100644
--- a/spec/mspec/spec/matchers/respond_to_spec.rb
+++ b/spec/mspec/spec/matchers/respond_to_spec.rb
@@ -2,32 +2,32 @@ require 'spec_helper'
require 'mspec/expectations/expectations'
require 'mspec/matchers'
-describe RespondToMatcher do
+RSpec.describe RespondToMatcher do
it "matches when actual does respond_to? expected" do
- RespondToMatcher.new(:to_s).matches?(Object.new).should == true
- RespondToMatcher.new(:inject).matches?([]).should == true
- RespondToMatcher.new(:[]).matches?(1).should == true
- RespondToMatcher.new(:[]=).matches?("string").should == true
+ expect(RespondToMatcher.new(:to_s).matches?(Object.new)).to eq(true)
+ expect(RespondToMatcher.new(:inject).matches?([])).to eq(true)
+ expect(RespondToMatcher.new(:[]).matches?(1)).to eq(true)
+ expect(RespondToMatcher.new(:[]=).matches?("string")).to eq(true)
end
it "does not match when actual does not respond_to? expected" do
- RespondToMatcher.new(:to_i).matches?(Object.new).should == false
- RespondToMatcher.new(:inject).matches?(1).should == false
- RespondToMatcher.new(:non_existent_method).matches?([]).should == false
- RespondToMatcher.new(:[]=).matches?(1).should == false
+ expect(RespondToMatcher.new(:to_i).matches?(Object.new)).to eq(false)
+ expect(RespondToMatcher.new(:inject).matches?(1)).to eq(false)
+ expect(RespondToMatcher.new(:non_existent_method).matches?([])).to eq(false)
+ expect(RespondToMatcher.new(:[]=).matches?(1)).to eq(false)
end
it "provides a useful failure message" do
matcher = RespondToMatcher.new(:non_existent_method)
matcher.matches?('string')
- matcher.failure_message.should == [
- "Expected \"string\" (String)", "to respond to non_existent_method"]
+ expect(matcher.failure_message).to eq([
+ "Expected \"string\" (String)", "to respond to non_existent_method"])
end
it "provides a useful negative failure message" do
matcher = RespondToMatcher.new(:to_i)
matcher.matches?(4.0)
- matcher.negative_failure_message.should == [
- "Expected 4.0 (Float)", "not to respond to to_i"]
+ expect(matcher.negative_failure_message).to eq([
+ "Expected 4.0 (Float)", "not to respond to to_i"])
end
end