From 1a30a56f2a955c2c2e99aeec26e45d068524eca3 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 8 Dec 2019 15:10:49 -0700 Subject: [PATCH] Better stringified call --- src/spectator/mocks/generic_method_call.cr | 7 +++++++ src/spectator/mocks/method_call.cr | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/spectator/mocks/generic_method_call.cr b/src/spectator/mocks/generic_method_call.cr index 628e40f..64f8999 100644 --- a/src/spectator/mocks/generic_method_call.cr +++ b/src/spectator/mocks/generic_method_call.cr @@ -8,5 +8,12 @@ module Spectator::Mocks def initialize(name : Symbol, @args : GenericArguments(T, NT)) super(name) end + + def to_s(io) + super + io << '(' + io << @args + io << ')' + end end end diff --git a/src/spectator/mocks/method_call.cr b/src/spectator/mocks/method_call.cr index 7c85862..00c6d0c 100644 --- a/src/spectator/mocks/method_call.cr +++ b/src/spectator/mocks/method_call.cr @@ -4,5 +4,10 @@ module Spectator::Mocks def initialize(@name : Symbol) end + + def to_s(io) + io << '#' + io << @name + end end end