Default raise if stub is called without defintion

This commit is contained in:
Michael Miller 2019-10-05 22:42:33 -06:00
parent 0528ddc2ab
commit 6b85bb7ed7

View file

@ -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