mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
MatchDataValue must be a class
Negatable value modifiers don't get updated when they're structs.
This commit is contained in:
parent
a19d9f00aa
commit
5e80b3835a
6 changed files with 6 additions and 6 deletions
|
@ -3,7 +3,7 @@ require "./match_data_value"
|
|||
module Spectator::Matchers
|
||||
# Selects a value based on whether the value is negated.
|
||||
# This is used when a matcher is negated.
|
||||
private struct AlternativeMatchDataValue(T1, T2) < MatchDataValue
|
||||
private class AlternativeMatchDataValue(T1, T2) < MatchDataValue
|
||||
# Creates the wrapper.
|
||||
def initialize(@value1 : T1, @value2 : T2)
|
||||
@negated = false
|
||||
|
|
|
@ -2,7 +2,7 @@ require "./match_data_value"
|
|||
|
||||
module Spectator::Matchers
|
||||
# Wraps a value for used in match data.
|
||||
private struct GenericMatchDataValue(T) < MatchDataValue
|
||||
private class GenericMatchDataValue(T) < MatchDataValue
|
||||
# Creates the wrapper.
|
||||
def initialize(@value : T)
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Spectator::Matchers
|
||||
# Abstract base for all match data values.
|
||||
# All sub-classes are expected to implement their own `#to_s`.
|
||||
private abstract struct MatchDataValue
|
||||
private abstract class MatchDataValue
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require "./match_data_value"
|
|||
module Spectator::Matchers
|
||||
# Wraps an expected value that can be negated.
|
||||
# This is used when a matcher is negated.
|
||||
private struct NegatableMatchDataValue(T) < MatchDataValue
|
||||
private class NegatableMatchDataValue(T) < MatchDataValue
|
||||
# Negatable value.
|
||||
getter value
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ require "./match_data_value"
|
|||
module Spectator::Matchers
|
||||
# Wraps a prefixed value that can be negated.
|
||||
# This is used when a matcher is negated.
|
||||
private struct NegatablePrefixedMatchDataValue(T) < MatchDataValue
|
||||
private class NegatablePrefixedMatchDataValue(T) < MatchDataValue
|
||||
# Negatable value.
|
||||
getter value
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require "./match_data_value"
|
|||
|
||||
module Spectator::Matchers
|
||||
# Prefixes (for output formatting) an actual or expected value.
|
||||
private struct PrefixedMatchDataValue(T) < MatchDataValue
|
||||
private class PrefixedMatchDataValue(T) < MatchDataValue
|
||||
# Value being prefixed.
|
||||
getter value : T
|
||||
|
||||
|
|
Loading…
Reference in a new issue