Basic to_s for stubs

This commit is contained in:
Michael Miller 2019-11-03 11:59:12 -07:00
parent d1b54ad48f
commit 9294599440
2 changed files with 14 additions and 0 deletions

View file

@ -14,5 +14,14 @@ module Spectator::Mocks
end
abstract def call(args : GenericArguments(T, NT)) : ReturnType forall T, NT
def to_s(io)
super(io)
if @args
io << '('
io << @args
io << ')'
end
end
end
end

View file

@ -9,5 +9,10 @@ module Spectator::Mocks
def callable?(call : GenericMethodCall(T, NT)) : Bool forall T, NT
@name == call.name
end
def to_s(io)
io << '#'
io << @name
end
end
end