From 0528ddc2abdc27ab153e7e731da64da252a3488b Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 5 Oct 2019 22:22:31 -0600 Subject: [PATCH] Handle stubbed methods with arguments --- src/spectator/double.cr | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/spectator/double.cr b/src/spectator/double.cr index 2991639..8e4237d 100644 --- a/src/spectator/double.cr +++ b/src/spectator/double.cr @@ -1,12 +1,10 @@ module Spectator abstract class Double macro stub(definition) - def {{definition.name.id}} - @internal.{{definition.name.id}} - end + delegate {{definition.name.id}}, to: @internal private class Internal - def {{definition.name.id}} + def {{definition.name.id}}({{definition.args.splat}}) {{definition.block.body}} end end