Fix fallout from last commit in Expectation spec

All tests pass in this commit!
This commit is contained in:
Michael Miller 2019-02-28 13:52:01 -07:00
parent e6ce54202d
commit b4af87f903

View file

@ -8,8 +8,8 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_true # Sanity check.
expectation.satisfied?.should be_true expectation.satisfied?.should be_true
end end
@ -19,8 +19,8 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_true # Sanity check.
expectation.satisfied?.should be_false expectation.satisfied?.should be_false
end end
end end
@ -33,8 +33,8 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_false # Sanity check.
expectation.satisfied?.should be_false expectation.satisfied?.should be_false
end end
@ -45,8 +45,8 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_false # Sanity check.
expectation.satisfied?.should be_true expectation.satisfied?.should be_true
end end
end end
@ -60,9 +60,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
match_data.matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_true # Sanity check. expectation.actual_message.should eq(match_data.message)
expectation.actual_message.should eq(matcher.message(partial))
end end
context "when negated" do context "when negated" do
@ -71,9 +71,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_true # Sanity check. expectation.actual_message.should eq(match_data.negated_message)
expectation.actual_message.should eq(matcher.negated_message(partial))
end end
end end
end end
@ -85,9 +85,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_false # Sanity check. expectation.actual_message.should eq(match_data.negated_message)
expectation.actual_message.should eq(matcher.negated_message(partial))
end end
context "when negated" do context "when negated" do
@ -97,9 +97,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_false # Sanity check. expectation.actual_message.should eq(match_data.message)
expectation.actual_message.should eq(matcher.message(partial))
end end
end end
end end
@ -112,9 +112,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_true # Sanity check. expectation.expected_message.should eq(match_data.message)
expectation.expected_message.should eq(matcher.message(partial))
end end
context "when negated" do context "when negated" do
@ -123,9 +123,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value) partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value) matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_true # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_true # Sanity check. expectation.expected_message.should eq(match_data.negated_message)
expectation.expected_message.should eq(matcher.negated_message(partial))
end end
end end
end end
@ -137,9 +137,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, false) expectation = Spectator::Expectations::Expectation.new(match_data, false)
matcher.match?(partial).should be_false # Sanity check. expectation.expected_message.should eq(match_data.message)
expectation.expected_message.should eq(matcher.message(partial))
end end
context "when negated" do context "when negated" do
@ -149,9 +149,9 @@ describe Spectator::Expectations::Expectation do
partial = new_partial(value1) partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2) matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
match_data = matcher.match(partial) match_data = matcher.match(partial)
matcher.match(partial).matched?.should be_false # Sanity check.
expectation = Spectator::Expectations::Expectation.new(match_data, true) expectation = Spectator::Expectations::Expectation.new(match_data, true)
matcher.match?(partial).should be_false # Sanity check. expectation.expected_message.should eq(match_data.negated_message)
expectation.expected_message.should eq(matcher.negated_message(partial))
end end
end end
end end