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
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{% begin %}
|
{% begin %}
|
||||||
{
|
{
|
||||||
{% for attribute in ExpectedType.keys %}
|
{% for attribute in ExpectedType.keys %}
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(@values.expected),
|
expected: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
|
|
@ -26,7 +26,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
subset: NegatableValue.new(@values.expected),
|
subset: NegatableValue.new(@values.expected),
|
||||||
superset: @values.actual,
|
superset: @values.actual,
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new([] of Nil),
|
expected: NegatableValue.new([] of Nil),
|
||||||
actual: @actual,
|
actual: @actual,
|
||||||
|
|
|
@ -37,7 +37,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(@values.expected),
|
expected: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
@ -66,7 +66,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: @values.expected,
|
expected: @values.expected,
|
||||||
actual: @last,
|
actual: @last,
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(@values.expected),
|
expected: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
|
|
@ -65,7 +65,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
"expected type": NegatableValue.new(ExceptionType),
|
"expected type": NegatableValue.new(ExceptionType),
|
||||||
"actual type": @values.actual.class,
|
"actual type": @values.actual.class,
|
||||||
|
@ -93,7 +93,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
"expected type": NegatableValue.new(ExceptionType),
|
"expected type": NegatableValue.new(ExceptionType),
|
||||||
"actual type": @values.actual.class,
|
"actual type": @values.actual.class,
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatablePrefixedValue.new(">=", "<", @values.expected),
|
expected: NegatablePrefixedValue.new(">=", "<", @values.expected),
|
||||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatablePrefixedValue.new(">", "<=", @values.expected),
|
expected: NegatablePrefixedValue.new(">", "<=", @values.expected),
|
||||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
actual = @values.actual
|
actual = @values.actual
|
||||||
{
|
{
|
||||||
key: NegatableValue.new(@values.expected),
|
key: NegatableValue.new(@values.expected),
|
||||||
|
|
|
@ -49,7 +49,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
subset: NegatableValue.new(@values.expected),
|
subset: NegatableValue.new(@values.expected),
|
||||||
superset: @values.actual,
|
superset: @values.actual,
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
actual = @values.actual
|
actual = @values.actual
|
||||||
{
|
{
|
||||||
value: NegatableValue.new(@values.expected),
|
value: NegatableValue.new(@values.expected),
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatablePrefixedValue.new("Not", "", @values.expected),
|
expected: NegatablePrefixedValue.new("Not", "", @values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatablePrefixedValue.new("<=", ">", @values.expected),
|
expected: NegatablePrefixedValue.new("<=", ">", @values.expected),
|
||||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatablePrefixedValue.new("<", ">=", @values.expected),
|
expected: NegatablePrefixedValue.new("<", ">=", @values.expected),
|
||||||
actual: PrefixedValue.new(actual_operator, @values.actual),
|
actual: PrefixedValue.new(actual_operator, @values.actual),
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(nil),
|
expected: NegatableValue.new(nil),
|
||||||
actual: @actual,
|
actual: @actual,
|
||||||
|
|
|
@ -45,12 +45,12 @@ module Spectator::Matchers
|
||||||
# Match data specific to this matcher.
|
# Match data specific to this matcher.
|
||||||
private struct MatchData(ActualType) < MatchData
|
private struct MatchData(ActualType) < MatchData
|
||||||
# Creates the match data.
|
# Creates the match data.
|
||||||
def initialize(matched, @values : ActualType, @actual_label : String)
|
def initialize(matched, @named_tuple : ActualType, @actual_label : String)
|
||||||
super(matched)
|
super(matched)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
getter values
|
getter named_tuple
|
||||||
|
|
||||||
# Describes the condition that satisfies the matcher.
|
# Describes the condition that satisfies the matcher.
|
||||||
# This is informational and displayed to the end-user.
|
# This is informational and displayed to the end-user.
|
||||||
|
|
|
@ -65,7 +65,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
lower: NegatablePrefixedValue.new(">=", "<", range.begin),
|
lower: NegatablePrefixedValue.new(">=", "<", range.begin),
|
||||||
upper: NegatablePrefixedValue.new(exclusive? ? "<" : "<=", exclusive? ? ">=" : ">", range.end),
|
upper: NegatablePrefixedValue.new(exclusive? ? "<" : "<=", exclusive? ? ">=" : ">", range.end),
|
||||||
|
@ -110,7 +110,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
set: NegatableValue.new(@values.expected),
|
set: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(@values.expected),
|
expected: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
|
|
@ -37,7 +37,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(@values.expected),
|
expected: NegatableValue.new(@values.expected),
|
||||||
actual: @values.actual,
|
actual: @values.actual,
|
||||||
|
@ -66,7 +66,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: @values.expected,
|
expected: @values.expected,
|
||||||
actual: @first,
|
actual: @first,
|
||||||
|
|
|
@ -95,7 +95,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
truthy = "Not false or nil"
|
truthy = "Not false or nil"
|
||||||
falsey = "false or nil"
|
falsey = "false or nil"
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ module Spectator::Matchers
|
||||||
end
|
end
|
||||||
|
|
||||||
# Information about the match.
|
# Information about the match.
|
||||||
def values
|
def named_tuple
|
||||||
{
|
{
|
||||||
expected: NegatableValue.new(ExpectedType),
|
expected: NegatableValue.new(ExpectedType),
|
||||||
actual: ActualType,
|
actual: ActualType,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue