diff options
Diffstat (limited to 'spec/mspec/spec/matchers/be_an_instance_of_spec.rb')
-rw-r--r-- | spec/mspec/spec/matchers/be_an_instance_of_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/mspec/spec/matchers/be_an_instance_of_spec.rb b/spec/mspec/spec/matchers/be_an_instance_of_spec.rb index 7f2126df7d..7c74249d24 100644 --- a/spec/mspec/spec/matchers/be_an_instance_of_spec.rb +++ b/spec/mspec/spec/matchers/be_an_instance_of_spec.rb @@ -13,38 +13,38 @@ module BeAnInOfSpecs end end -describe BeAnInstanceOfMatcher do +RSpec.describe BeAnInstanceOfMatcher do it "matches when actual is an instance_of? expected" do a = BeAnInOfSpecs::A.new - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(a).should be_true + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(a)).to be_truthy b = BeAnInOfSpecs::B.new - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(b).should be_true + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(b)).to be_truthy end it "does not match when actual is not an instance_of? expected" do a = BeAnInOfSpecs::A.new - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(a).should be_false + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(a)).to be_falsey b = BeAnInOfSpecs::B.new - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(b).should be_false + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(b)).to be_falsey c = BeAnInOfSpecs::C.new - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(c).should be_false - BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(c).should be_false + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(c)).to be_falsey + expect(BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(c)).to be_falsey end it "provides a useful failure message" do matcher = BeAnInstanceOfMatcher.new(Numeric) matcher.matches?("string") - matcher.failure_message.should == [ - "Expected \"string\" (String)", "to be an instance of Numeric"] + expect(matcher.failure_message).to eq([ + "Expected \"string\" (String)", "to be an instance of Numeric"]) end it "provides a useful negative failure message" do matcher = BeAnInstanceOfMatcher.new(Numeric) matcher.matches?(4.0) - matcher.negative_failure_message.should == [ - "Expected 4.0 (Float)", "not to be an instance of Numeric"] + expect(matcher.negative_failure_message).to eq([ + "Expected 4.0 (Float)", "not to be an instance of Numeric"]) end end |