diff --git a/src/spectator/double.cr b/src/spectator/double.cr index 8e4237d..aeed0c1 100644 --- a/src/spectator/double.cr +++ b/src/spectator/double.cr @@ -5,7 +5,11 @@ module Spectator private class Internal def {{definition.name.id}}({{definition.args.splat}}) - {{definition.block.body}} + {% if definition.block.is_a?(Nop) %} + raise "Stubbed method called without being allowed" + {% else %} + {{definition.block.body}} + {% end %} end end end