From a53bafe333db70b0d0b0f21a155d15724fb83a04 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 31 Jan 2019 13:42:24 -0700 Subject: [PATCH] Remove (now pointless) ConditionMatcher --- src/spectator/matchers/condition_matcher.cr | 9 --------- src/spectator/matchers/empty_matcher.cr | 4 ++-- src/spectator/matchers/nil_matcher.cr | 4 ++-- src/spectator/matchers/type_matcher.cr | 4 ++-- 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 src/spectator/matchers/condition_matcher.cr diff --git a/src/spectator/matchers/condition_matcher.cr b/src/spectator/matchers/condition_matcher.cr deleted file mode 100644 index 8603c61..0000000 --- a/src/spectator/matchers/condition_matcher.cr +++ /dev/null @@ -1,9 +0,0 @@ -require "./matcher" - -module Spectator::Matchers - # Category of matcher that checks if an actual value satisfies a condition. - # Sub-types must implement `#match?`, `#message`, and `#negated_message`. - # Those methods accept a `ValueExpectationPartial` to work with. - abstract struct ConditionMatcher < Matcher - end -end diff --git a/src/spectator/matchers/empty_matcher.cr b/src/spectator/matchers/empty_matcher.cr index 655ee24..4dd192f 100644 --- a/src/spectator/matchers/empty_matcher.cr +++ b/src/spectator/matchers/empty_matcher.cr @@ -1,9 +1,9 @@ -require "./value_matcher" +require "./matcher" module Spectator::Matchers # Matcher that tests whether a collection is empty. # The values are checked with the `#empty?` method. - struct EmptyMatcher < ConditionMatcher + struct EmptyMatcher < Matcher # Creates the matcher. def initialize super("empty?") diff --git a/src/spectator/matchers/nil_matcher.cr b/src/spectator/matchers/nil_matcher.cr index f524898..1601857 100644 --- a/src/spectator/matchers/nil_matcher.cr +++ b/src/spectator/matchers/nil_matcher.cr @@ -1,9 +1,9 @@ -require "./value_matcher" +require "./matcher" module Spectator::Matchers # Common matcher that tests whether a value is nil. # The values are compared with the `#nil?` method. - struct NilMatcher < ConditionMatcher + struct NilMatcher < Matcher # Creates the matcher. def initialize super("nil?") diff --git a/src/spectator/matchers/type_matcher.cr b/src/spectator/matchers/type_matcher.cr index 0a82321..3c07629 100644 --- a/src/spectator/matchers/type_matcher.cr +++ b/src/spectator/matchers/type_matcher.cr @@ -1,9 +1,9 @@ -require "./condition_matcher" +require "./matcher" module Spectator::Matchers # Matcher that tests a value is of a specified type. # The values are compared with the `#is_a?` method. - struct TypeMatcher(Expected) < ConditionMatcher + struct TypeMatcher(Expected) < Matcher # Creates the type matcher. # The `Expected` type param will be used to populate the underlying label. def initialize