Fix negation expectation text

This commit is contained in:
Michael Miller 2020-01-06 22:11:36 -07:00
parent 590d81979e
commit 5fa6b5d549
2 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,7 @@ module Spectator::Matchers
private def negated_match_ends_with(actual_value, actual_label)
if actual_value.ends_with?(expected.value)
FailedMatchData.new(description, "#{actual_label} ends with #{expected.label} (using #ends_with?)",
expected: expected.value.inspect,
expected: "Not #{expected.value.inspect}",
actual: actual_value.inspect
)
else
@ -93,7 +93,7 @@ module Spectator::Matchers
if expected.value === last
FailedMatchData.new(description, "#{actual_label} ends with #{expected.label} (using expected === last)",
expected: expected.value.inspect,
expected: "Not #{expected.value.inspect}",
actual: last.inspect,
list: list.inspect
)

View File

@ -76,7 +76,7 @@ module Spectator::Matchers
private def negated_match_starts_with(actual_value, actual_label)
if actual_value.starts_with?(expected.value)
FailedMatchData.new(description, "#{actual_label} starts with #{expected.label} (using #starts_with?)",
expected: expected.value.inspect,
expected: "Not #{expected.value.inspect}",
actual: actual_value.inspect
)
else
@ -92,7 +92,7 @@ module Spectator::Matchers
if expected.value === first
FailedMatchData.new(description, "#{actual_label} starts with #{expected.label} (using expected === first)",
expected: expected.value.inspect,
expected: "Not #{expected.value.inspect}",
actual: first.inspect,
list: list.inspect
)