From 4b2b37477e00fe22d14bbc94f5fe8aa4d5145d68 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 12 Jul 2022 18:04:55 -0600 Subject: [PATCH] Remove unused methods --- src/spectator/matchers/receive_matcher.cr | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/spectator/matchers/receive_matcher.cr b/src/spectator/matchers/receive_matcher.cr index 526d47f..1fe0664 100644 --- a/src/spectator/matchers/receive_matcher.cr +++ b/src/spectator/matchers/receive_matcher.cr @@ -6,9 +6,12 @@ require "./matcher" module Spectator::Matchers # Matcher that inspects stubbable objects for method calls. struct ReceiveMatcher < Matcher + # Creates the matcher for expecting a method call matching a stub. def initialize(@stub : Stub) end + # Creates the matcher for expecting a method call with any arguments. + # *expected* is an expression evaluating to the method name as a symbol. def initialize(expected : Expression(Symbol)) stub = NullStub.new(expected.value).as(Stub) initialize(stub) @@ -55,18 +58,6 @@ module Spectator::Matchers {% raise "Value being checked with `have_received` must be stubbable (mock or double)." %} end - private def match_data_description(actual : Expression(T)) : String forall T - match_data_description(actual.label) - end - - private def match_data_description(actual_label : String | Symbol) : String - "#{actual_label} #{description}" - end - - private def match_data_description(actual_label : Nil) : String - description - end - # Additional information about the match failure. private def values(actual : Expression(T)) forall T {