Remove dummy MatchData type

Also fix for undefined MatchData type in Matcher types.
This commit is contained in:
Michael Miller 2019-02-28 13:53:54 -07:00
parent b4af87f903
commit 520901332e
2 changed files with 2 additions and 30 deletions

View file

@ -1,30 +0,0 @@
require "./match_data"
module Spectator::Matchers
# Match data that does nothing useful.
# This is a workaround for a compilation issue - hopefully temporary.
# This might be the same issue that `DummyExample` solves.
# Without this, the Crystal compiler complains:
# ```text
# undefined method 'Spectator::Matchers::MatchData#message()'
# ```
# The method is clearly defined by `MatchData`, just abstract.
# Additionally, there are implementations of `MatchData` -
# see `NilMatcher::MatchData`.
private struct DummyMatchData < MatchData
# Dummy values.
def values
{expected: nil, actual: nil}
end
# Dummy message.
def message
"DUMMY"
end
# Dummy message.
def negated_message
"DUMMY"
end
end
end

View file

@ -1,3 +1,5 @@
require "./match_data"
module Spectator::Matchers
# Common base class for all expectation conditions.
# A matcher looks at something produced by the SUT