Remove Matcher methods moved to MatchData

Update spec for EqualityMatcher to reflect this.
This commit is contained in:
Michael Miller 2019-02-28 13:47:50 -07:00
parent b4502711cd
commit e6ce54202d
2 changed files with 131 additions and 132 deletions

View file

@ -4,12 +4,6 @@ module Spectator::Matchers
# Common matcher that tests whether two values equal each other.
# The values are compared with the == operator.
struct EqualityMatcher(ExpectedType) < ValueMatcher(ExpectedType)
# Determines whether the matcher is satisfied with the value given to it.
# True is returned if the match was successful, false otherwise.
def match?(partial)
partial.actual == expected
end
# Determines whether the matcher is satisfied with the partial given to it.
# `MatchData` is returned that contains information about the match.
def match(partial) : MatchData
@ -18,18 +12,6 @@ module Spectator::Matchers
MatchData.new(matched, expected, actual, partial.label, label)
end
# Describes the condition that satisfies the matcher.
# This is informational and displayed to the end-user.
def message(partial)
"Expected #{partial.label} to equal #{label} (using ==)"
end
# Describes the condition that won't satsify the matcher.
# This is informational and displayed to the end-user.
def negated_message(partial)
"Expected #{partial.label} to not equal #{label} (using ==)"
end
# Match data specific to this matcher.
private struct MatchData(ExpectedType, ActualType) < MatchData
# Creates the match data.