Rename values to named_tuple in match data types

This commit is contained in:
Michael Miller 2019-03-22 10:41:23 -06:00
parent 8d3ab0d44c
commit 4f6309a032
22 changed files with 27 additions and 27 deletions

View file

@ -45,7 +45,7 @@ module Spectator::Matchers
end
# Information about the match.
def values
def named_tuple
{% begin %}
{
{% for attribute in ExpectedType.keys %}

View file

@ -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,

View file

@ -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,

View file

@ -25,7 +25,7 @@ module Spectator::Matchers
end
# Information about the match.
def values
def named_tuple
{
expected: NegatableValue.new([] of Nil),
actual: @actual,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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,

View file

@ -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),

View file

@ -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,

View file

@ -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),

View file

@ -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),

View file

@ -25,7 +25,7 @@ module Spectator::Matchers
end
# Information about the match.
def values
def named_tuple
{
expected: NegatableValue.new(nil),
actual: @actual,

View file

@ -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.

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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"
{

View file

@ -30,7 +30,7 @@ module Spectator::Matchers
end
# Information about the match.
def values
def named_tuple
{
expected: NegatableValue.new(ExpectedType),
actual: ActualType,