summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/matchers/match_yaml_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-03-27 13:02:38 +0100
committerBenoit Daloze <eregontp@gmail.com>2021-03-27 13:02:38 +0100
commit44736a6b7a2b3475db2d05187f33e3c1a7b4b4e5 (patch)
tree4cb679a8742121782a50e72e01160d19f479f9a6 /spec/mspec/spec/matchers/match_yaml_spec.rb
parent31ae931e166825450dcc16d470553e67281951a2 (diff)
Update to ruby/mspec@d1adf59
Diffstat (limited to 'spec/mspec/spec/matchers/match_yaml_spec.rb')
-rw-r--r--spec/mspec/spec/matchers/match_yaml_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/mspec/spec/matchers/match_yaml_spec.rb b/spec/mspec/spec/matchers/match_yaml_spec.rb
index 4f16aee0ec..85123bb87d 100644
--- a/spec/mspec/spec/matchers/match_yaml_spec.rb
+++ b/spec/mspec/spec/matchers/match_yaml_spec.rb
@@ -2,38 +2,38 @@ require 'spec_helper'
require 'mspec/expectations/expectations'
require 'mspec/matchers'
-describe MatchYAMLMatcher do
+RSpec.describe MatchYAMLMatcher do
before :each do
@matcher = MatchYAMLMatcher.new("--- \nfoo: bar\n")
end
it "compares YAML documents and matches if they're equivalent" do
- @matcher.matches?("--- \nfoo: bar\n").should == true
+ expect(@matcher.matches?("--- \nfoo: bar\n")).to eq(true)
end
it "compares YAML documents and does not match if they're not equivalent" do
- @matcher.matches?("--- \nbar: foo\n").should == false
- @matcher.matches?("--- \nfoo: \nbar\n").should == false
+ expect(@matcher.matches?("--- \nbar: foo\n")).to eq(false)
+ expect(@matcher.matches?("--- \nfoo: \nbar\n")).to eq(false)
end
it "also receives objects that respond_to to_yaml" do
matcher = MatchYAMLMatcher.new("some string")
- matcher.matches?("some string").should == true
+ expect(matcher.matches?("some string")).to eq(true)
matcher = MatchYAMLMatcher.new(['a', 'b'])
- matcher.matches?("--- \n- a\n- b\n").should == true
+ expect(matcher.matches?("--- \n- a\n- b\n")).to eq(true)
matcher = MatchYAMLMatcher.new("foo" => "bar")
- matcher.matches?("--- \nfoo: bar\n").should == true
+ expect(matcher.matches?("--- \nfoo: bar\n")).to eq(true)
end
it "matches documents with trailing whitespace" do
- @matcher.matches?("--- \nfoo: bar \n").should == true
- @matcher.matches?("--- \nfoo: bar \n").should == true
+ expect(@matcher.matches?("--- \nfoo: bar \n")).to eq(true)
+ expect(@matcher.matches?("--- \nfoo: bar \n")).to eq(true)
end
it "fails with a descriptive error message" do
- @matcher.matches?("foo").should == false
- @matcher.failure_message.should == ["Expected \"foo\"", " to match \"--- \\nfoo: bar\\n\""]
+ expect(@matcher.matches?("foo")).to eq(false)
+ expect(@matcher.failure_message).to eq(["Expected \"foo\"", " to match \"--- \\nfoo: bar\\n\""])
end
end