Remove reference to test

Disallows group context values being used within double definitions.
This had an adverse effect where context values could be called on the
double (dbl.foo).
This commit is contained in:
Michael Miller 2019-11-11 20:59:12 -07:00
parent 96aae8f6d5
commit fd2c6d3d8c

View file

@ -3,15 +3,13 @@ require "../mocks"
module Spectator::DSL
macro double(name, &block)
{% if block.is_a?(Nop) %}
Double{{name.id}}.new(self)
Double{{name.id}}.new
{% else %}
class Double{{name.id}} < ::Spectator::Mocks::Double
def initialize(@spectator_test : {{@type.id}})
def initialize
super({{name.id.symbolize}})
end
forward_missing_to @spectator_test
{{block.body}}
end
{% end %}