mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove dummy MatchData type
Also fix for undefined MatchData type in Matcher types.
This commit is contained in:
parent
b4af87f903
commit
520901332e
2 changed files with 2 additions and 30 deletions
|
@ -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
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require "./match_data"
|
||||||
|
|
||||||
module Spectator::Matchers
|
module Spectator::Matchers
|
||||||
# Common base class for all expectation conditions.
|
# Common base class for all expectation conditions.
|
||||||
# A matcher looks at something produced by the SUT
|
# A matcher looks at something produced by the SUT
|
||||||
|
|
Loading…
Reference in a new issue