mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Re-add MatchData and variants
This commit is contained in:
parent
ae43c930bf
commit
acd01a23e6
3 changed files with 31 additions and 0 deletions
17
src/spectator/matchers/failed_match_data.cr
Normal file
17
src/spectator/matchers/failed_match_data.cr
Normal 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
|
5
src/spectator/matchers/match_data.cr
Normal file
5
src/spectator/matchers/match_data.cr
Normal file
|
@ -0,0 +1,5 @@
|
|||
module Spectator::Matchers
|
||||
abstract struct MatchData
|
||||
abstract def matched? : Bool
|
||||
end
|
||||
end
|
9
src/spectator/matchers/successful_match_data.cr
Normal file
9
src/spectator/matchers/successful_match_data.cr
Normal file
|
@ -0,0 +1,9 @@
|
|||
require "./match_data"
|
||||
|
||||
module Spectator::Matchers
|
||||
struct SuccessfulMatchData < MatchData
|
||||
def matched?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue