diff options
Diffstat (limited to 'spec/mspec/spec/matchers/have_method_spec.rb')
-rw-r--r-- | spec/mspec/spec/matchers/have_method_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/mspec/spec/matchers/have_method_spec.rb b/spec/mspec/spec/matchers/have_method_spec.rb index 41bd485119..4fc0bf5e45 100644 --- a/spec/mspec/spec/matchers/have_method_spec.rb +++ b/spec/mspec/spec/matchers/have_method_spec.rb @@ -12,44 +12,44 @@ class HMMSpecs end end -describe HaveMethodMatcher do +RSpec.describe HaveMethodMatcher do it "inherits from MethodMatcher" do - HaveMethodMatcher.new(:m).should be_kind_of(MethodMatcher) + expect(HaveMethodMatcher.new(:m)).to be_kind_of(MethodMatcher) end it "matches when mod has the method" do matcher = HaveMethodMatcher.new :instance_method - matcher.matches?(HMMSpecs).should be_true - matcher.matches?(HMMSpecs.new).should be_true - matcher.matches?(HMMSpecs::Subclass).should be_true - matcher.matches?(HMMSpecs::Subclass.new).should be_true + expect(matcher.matches?(HMMSpecs)).to be_truthy + expect(matcher.matches?(HMMSpecs.new)).to be_truthy + expect(matcher.matches?(HMMSpecs::Subclass)).to be_truthy + expect(matcher.matches?(HMMSpecs::Subclass.new)).to be_truthy end it "does not match when mod does not have the method" do matcher = HaveMethodMatcher.new :another_method - matcher.matches?(HMMSpecs).should be_false + expect(matcher.matches?(HMMSpecs)).to be_falsey end it "does not match if the method is in a superclass and include_super is false" do matcher = HaveMethodMatcher.new :instance_method, false - matcher.matches?(HMMSpecs::Subclass).should be_false + expect(matcher.matches?(HMMSpecs::Subclass)).to be_falsey end it "provides a failure message for #should" do matcher = HaveMethodMatcher.new :some_method matcher.matches?(HMMSpecs) - matcher.failure_message.should == [ + expect(matcher.failure_message).to eq([ "Expected HMMSpecs to have method 'some_method'", "but it does not" - ] + ]) end it "provides a failure messoge for #should_not" do matcher = HaveMethodMatcher.new :some_method matcher.matches?(HMMSpecs) - matcher.negative_failure_message.should == [ + expect(matcher.negative_failure_message).to eq([ "Expected HMMSpecs NOT to have method 'some_method'", "but it does" - ] + ]) end end |