From 5fd1547ceda2c4bd5f92ed359dbdf289d52f3f8a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 6 Mar 2019 12:01:32 -0700 Subject: [PATCH] Fix verbage around failure message --- spec/expectations/expectation_spec.cr | 8 ++++---- src/spectator/expectations/expectation.cr | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/expectations/expectation_spec.cr b/spec/expectations/expectation_spec.cr index 8bd0a8d..7b60173 100644 --- a/spec/expectations/expectation_spec.cr +++ b/spec/expectations/expectation_spec.cr @@ -61,12 +61,12 @@ describe Spectator::Expectations::Expectation do end context "when negated" do - it "equals the matcher's #negated_message" do + it "equals the matcher's #message" do value = 42 match_data = new_matcher(value).match(new_partial(value)) match_data.matched?.should be_true # Sanity check. expectation = Spectator::Expectations::Expectation.new(match_data, true) - expectation.actual_message.should eq(match_data.negated_message) + expectation.actual_message.should eq(match_data.message) end end end @@ -80,11 +80,11 @@ describe Spectator::Expectations::Expectation do end context "when negated" do - it "equals the matcher's #message" do + it "equals the matcher's #negated_message" do match_data = new_matcher(42).match(new_partial(777)) match_data.matched?.should be_false # Sanity check. expectation = Spectator::Expectations::Expectation.new(match_data, true) - expectation.actual_message.should eq(match_data.message) + expectation.actual_message.should eq(match_data.negated_message) end end end diff --git a/src/spectator/expectations/expectation.cr b/src/spectator/expectations/expectation.cr index c53a5f9..91079a9 100644 --- a/src/spectator/expectations/expectation.cr +++ b/src/spectator/expectations/expectation.cr @@ -31,7 +31,7 @@ module Spectator::Expectations # Text that indicates what the outcome was. def actual_message - satisfied? ? @match_data.message : @match_data.negated_message + @match_data.matched? ? @match_data.message : @match_data.negated_message end end end