Avoid printing double contents from to_s

This commit is contained in:
Michael Miller 2022-11-04 20:35:43 -06:00
parent 1093571fbd
commit 12eb2e9357
No known key found for this signature in database
GPG Key ID: 32B47AE8F388A1FF
1 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,12 @@ module Spectator
false
end
# Simplified string representation of a double.
# Avoids displaying nested content and bloating method instantiation.
def to_s(io : IO) : Nil
io << _spectator_stubbed_name
end
# Defines a stub to change the behavior of a method in this double.
#
# NOTE: Defining a stub for a method not defined in the double's type has no effect.