Handle stubbed methods with arguments

This commit is contained in:
Michael Miller 2019-10-05 22:22:31 -06:00
parent 47ca96801b
commit 0528ddc2ab

View file

@ -1,12 +1,10 @@
module Spectator module Spectator
abstract class Double abstract class Double
macro stub(definition) macro stub(definition)
def {{definition.name.id}} delegate {{definition.name.id}}, to: @internal
@internal.{{definition.name.id}}
end
private class Internal private class Internal
def {{definition.name.id}} def {{definition.name.id}}({{definition.args.splat}})
{{definition.block.body}} {{definition.block.body}}
end end
end end