Re-add MatchData and variants

This commit is contained in:
Michael Miller 2019-08-01 14:04:00 -06:00
parent ae43c930bf
commit acd01a23e6
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,17 @@
require "./labeled_value"
require "./match_data"
module Spectator::Matchers
struct FailedMatchData < MatchData
def matched?
false
end
getter failure_message : String
getter values : Array(LabeledValue)
def initialize(@failure_message, @values = [] of LabeledValue)
end
end
end

View file

@ -0,0 +1,5 @@
module Spectator::Matchers
abstract struct MatchData
abstract def matched? : Bool
end
end

View file

@ -0,0 +1,9 @@
require "./match_data"
module Spectator::Matchers
struct SuccessfulMatchData < MatchData
def matched?
true
end
end
end