mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename values to named_tuple in match data types
This commit is contained in:
parent
8d3ab0d44c
commit
4f6309a032
22 changed files with 27 additions and 27 deletions
|
@ -45,7 +45,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{% begin %}
|
||||
{
|
||||
{% for attribute in ExpectedType.keys %}
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
|
|
@ -26,7 +26,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
subset: NegatableValue.new(@values.expected),
|
||||
superset: @values.actual,
|
||||
|
|
|
@ -25,7 +25,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new([] of Nil),
|
||||
actual: @actual,
|
||||
|
|
|
@ -37,7 +37,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
@ -66,7 +66,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: @values.expected,
|
||||
actual: @last,
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
|
|
@ -65,7 +65,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
"expected type": NegatableValue.new(ExceptionType),
|
||||
"actual type": @values.actual.class,
|
||||
|
@ -93,7 +93,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
"expected type": NegatableValue.new(ExceptionType),
|
||||
"actual type": @values.actual.class,
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatablePrefixedValue.new(">=", "<", @values.expected),
|
||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatablePrefixedValue.new(">", "<=", @values.expected),
|
||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
actual = @values.actual
|
||||
{
|
||||
key: NegatableValue.new(@values.expected),
|
||||
|
|
|
@ -49,7 +49,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
subset: NegatableValue.new(@values.expected),
|
||||
superset: @values.actual,
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
actual = @values.actual
|
||||
{
|
||||
value: NegatableValue.new(@values.expected),
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatablePrefixedValue.new("Not", "", @values.expected),
|
||||
actual: @values.actual,
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatablePrefixedValue.new("<=", ">", @values.expected),
|
||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatablePrefixedValue.new("<", ">=", @values.expected),
|
||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||
|
|
|
@ -25,7 +25,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(nil),
|
||||
actual: @actual,
|
||||
|
|
|
@ -45,12 +45,12 @@ module Spectator::Matchers
|
|||
# Match data specific to this matcher.
|
||||
private struct MatchData(ActualType) < MatchData
|
||||
# Creates the match data.
|
||||
def initialize(matched, @values : ActualType, @actual_label : String)
|
||||
def initialize(matched, @named_tuple : ActualType, @actual_label : String)
|
||||
super(matched)
|
||||
end
|
||||
|
||||
# Information about the match.
|
||||
getter values
|
||||
getter named_tuple
|
||||
|
||||
# Describes the condition that satisfies the matcher.
|
||||
# This is informational and displayed to the end-user.
|
||||
|
|
|
@ -65,7 +65,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
lower: NegatablePrefixedValue.new(">=", "<", range.begin),
|
||||
upper: NegatablePrefixedValue.new(exclusive? ? "<" : "<=", exclusive? ? ">=" : ">", range.end),
|
||||
|
@ -110,7 +110,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
set: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
|
|
@ -37,7 +37,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(@values.expected),
|
||||
actual: @values.actual,
|
||||
|
@ -66,7 +66,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: @values.expected,
|
||||
actual: @first,
|
||||
|
|
|
@ -95,7 +95,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
truthy = "Not false or nil"
|
||||
falsey = "false or nil"
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ module Spectator::Matchers
|
|||
end
|
||||
|
||||
# Information about the match.
|
||||
def values
|
||||
def named_tuple
|
||||
{
|
||||
expected: NegatableValue.new(ExpectedType),
|
||||
actual: ActualType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue