From 4f6309a032445fabb8fb5bc4fc852150104e1a75 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 22 Mar 2019 10:41:23 -0600 Subject: [PATCH] Rename values to named_tuple in match data types --- src/spectator/matchers/attributes_matcher.cr | 2 +- src/spectator/matchers/case_matcher.cr | 2 +- src/spectator/matchers/contain_matcher.cr | 2 +- src/spectator/matchers/empty_matcher.cr | 2 +- src/spectator/matchers/end_with_matcher.cr | 4 ++-- src/spectator/matchers/equality_matcher.cr | 2 +- src/spectator/matchers/exception_matcher.cr | 4 ++-- src/spectator/matchers/greater_than_equal_matcher.cr | 2 +- src/spectator/matchers/greater_than_matcher.cr | 2 +- src/spectator/matchers/have_key_matcher.cr | 2 +- src/spectator/matchers/have_matcher.cr | 2 +- src/spectator/matchers/have_value_matcher.cr | 2 +- src/spectator/matchers/inequality_matcher.cr | 2 +- src/spectator/matchers/less_than_equal_matcher.cr | 2 +- src/spectator/matchers/less_than_matcher.cr | 2 +- src/spectator/matchers/nil_matcher.cr | 2 +- src/spectator/matchers/predicate_matcher.cr | 4 ++-- src/spectator/matchers/range_matcher.cr | 4 ++-- src/spectator/matchers/regex_matcher.cr | 2 +- src/spectator/matchers/start_with_matcher.cr | 4 ++-- src/spectator/matchers/truthy_matcher.cr | 2 +- src/spectator/matchers/type_matcher.cr | 2 +- 22 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/spectator/matchers/attributes_matcher.cr b/src/spectator/matchers/attributes_matcher.cr index 9545856..21e7605 100644 --- a/src/spectator/matchers/attributes_matcher.cr +++ b/src/spectator/matchers/attributes_matcher.cr @@ -45,7 +45,7 @@ module Spectator::Matchers end # Information about the match. - def values + def named_tuple {% begin %} { {% for attribute in ExpectedType.keys %} diff --git a/src/spectator/matchers/case_matcher.cr b/src/spectator/matchers/case_matcher.cr index 7757a9e..d90fe75 100644 --- a/src/spectator/matchers/case_matcher.cr +++ b/src/spectator/matchers/case_matcher.cr @@ -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, diff --git a/src/spectator/matchers/contain_matcher.cr b/src/spectator/matchers/contain_matcher.cr index 5feaf12..2e1d849 100644 --- a/src/spectator/matchers/contain_matcher.cr +++ b/src/spectator/matchers/contain_matcher.cr @@ -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, diff --git a/src/spectator/matchers/empty_matcher.cr b/src/spectator/matchers/empty_matcher.cr index 74196eb..09aada7 100644 --- a/src/spectator/matchers/empty_matcher.cr +++ b/src/spectator/matchers/empty_matcher.cr @@ -25,7 +25,7 @@ module Spectator::Matchers end # Information about the match. - def values + def named_tuple { expected: NegatableValue.new([] of Nil), actual: @actual, diff --git a/src/spectator/matchers/end_with_matcher.cr b/src/spectator/matchers/end_with_matcher.cr index b1781f4..6e99862 100644 --- a/src/spectator/matchers/end_with_matcher.cr +++ b/src/spectator/matchers/end_with_matcher.cr @@ -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, diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index b208063..be08053 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -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, diff --git a/src/spectator/matchers/exception_matcher.cr b/src/spectator/matchers/exception_matcher.cr index 8702c54..9c5d9cb 100644 --- a/src/spectator/matchers/exception_matcher.cr +++ b/src/spectator/matchers/exception_matcher.cr @@ -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, diff --git a/src/spectator/matchers/greater_than_equal_matcher.cr b/src/spectator/matchers/greater_than_equal_matcher.cr index 73ffb54..396e669 100644 --- a/src/spectator/matchers/greater_than_equal_matcher.cr +++ b/src/spectator/matchers/greater_than_equal_matcher.cr @@ -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), diff --git a/src/spectator/matchers/greater_than_matcher.cr b/src/spectator/matchers/greater_than_matcher.cr index 596f085..255c8b1 100644 --- a/src/spectator/matchers/greater_than_matcher.cr +++ b/src/spectator/matchers/greater_than_matcher.cr @@ -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), diff --git a/src/spectator/matchers/have_key_matcher.cr b/src/spectator/matchers/have_key_matcher.cr index 2e97efc..0aa461a 100644 --- a/src/spectator/matchers/have_key_matcher.cr +++ b/src/spectator/matchers/have_key_matcher.cr @@ -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), diff --git a/src/spectator/matchers/have_matcher.cr b/src/spectator/matchers/have_matcher.cr index b89fbda..95e7412 100644 --- a/src/spectator/matchers/have_matcher.cr +++ b/src/spectator/matchers/have_matcher.cr @@ -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, diff --git a/src/spectator/matchers/have_value_matcher.cr b/src/spectator/matchers/have_value_matcher.cr index e95b66f..192e545 100644 --- a/src/spectator/matchers/have_value_matcher.cr +++ b/src/spectator/matchers/have_value_matcher.cr @@ -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), diff --git a/src/spectator/matchers/inequality_matcher.cr b/src/spectator/matchers/inequality_matcher.cr index e39ec20..0abf617 100644 --- a/src/spectator/matchers/inequality_matcher.cr +++ b/src/spectator/matchers/inequality_matcher.cr @@ -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, diff --git a/src/spectator/matchers/less_than_equal_matcher.cr b/src/spectator/matchers/less_than_equal_matcher.cr index 0fee904..f1a930c 100644 --- a/src/spectator/matchers/less_than_equal_matcher.cr +++ b/src/spectator/matchers/less_than_equal_matcher.cr @@ -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), diff --git a/src/spectator/matchers/less_than_matcher.cr b/src/spectator/matchers/less_than_matcher.cr index 09094ff..e96e37b 100644 --- a/src/spectator/matchers/less_than_matcher.cr +++ b/src/spectator/matchers/less_than_matcher.cr @@ -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), diff --git a/src/spectator/matchers/nil_matcher.cr b/src/spectator/matchers/nil_matcher.cr index a69e2ba..336b0cc 100644 --- a/src/spectator/matchers/nil_matcher.cr +++ b/src/spectator/matchers/nil_matcher.cr @@ -25,7 +25,7 @@ module Spectator::Matchers end # Information about the match. - def values + def named_tuple { expected: NegatableValue.new(nil), actual: @actual, diff --git a/src/spectator/matchers/predicate_matcher.cr b/src/spectator/matchers/predicate_matcher.cr index 4208ee1..41f9f44 100644 --- a/src/spectator/matchers/predicate_matcher.cr +++ b/src/spectator/matchers/predicate_matcher.cr @@ -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. diff --git a/src/spectator/matchers/range_matcher.cr b/src/spectator/matchers/range_matcher.cr index 86bac32..6829466 100644 --- a/src/spectator/matchers/range_matcher.cr +++ b/src/spectator/matchers/range_matcher.cr @@ -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, diff --git a/src/spectator/matchers/regex_matcher.cr b/src/spectator/matchers/regex_matcher.cr index 6bc5181..f1550d0 100644 --- a/src/spectator/matchers/regex_matcher.cr +++ b/src/spectator/matchers/regex_matcher.cr @@ -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, diff --git a/src/spectator/matchers/start_with_matcher.cr b/src/spectator/matchers/start_with_matcher.cr index 5f4afbb..b697006 100644 --- a/src/spectator/matchers/start_with_matcher.cr +++ b/src/spectator/matchers/start_with_matcher.cr @@ -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, diff --git a/src/spectator/matchers/truthy_matcher.cr b/src/spectator/matchers/truthy_matcher.cr index c1cf1e1..0a35fb8 100644 --- a/src/spectator/matchers/truthy_matcher.cr +++ b/src/spectator/matchers/truthy_matcher.cr @@ -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" { diff --git a/src/spectator/matchers/type_matcher.cr b/src/spectator/matchers/type_matcher.cr index 16c26fa..4892bbd 100644 --- a/src/spectator/matchers/type_matcher.cr +++ b/src/spectator/matchers/type_matcher.cr @@ -30,7 +30,7 @@ module Spectator::Matchers end # Information about the match. - def values + def named_tuple { expected: NegatableValue.new(ExpectedType), actual: ActualType,