diff --git a/src/spectator/matchers/failed_match_data.cr b/src/spectator/matchers/failed_match_data.cr new file mode 100644 index 0000000..5855de5 --- /dev/null +++ b/src/spectator/matchers/failed_match_data.cr @@ -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 diff --git a/src/spectator/matchers/match_data.cr b/src/spectator/matchers/match_data.cr new file mode 100644 index 0000000..321e27a --- /dev/null +++ b/src/spectator/matchers/match_data.cr @@ -0,0 +1,5 @@ +module Spectator::Matchers + abstract struct MatchData + abstract def matched? : Bool + end +end diff --git a/src/spectator/matchers/successful_match_data.cr b/src/spectator/matchers/successful_match_data.cr new file mode 100644 index 0000000..b4cdb5a --- /dev/null +++ b/src/spectator/matchers/successful_match_data.cr @@ -0,0 +1,9 @@ +require "./match_data" + +module Spectator::Matchers + struct SuccessfulMatchData < MatchData + def matched? + true + end + end +end