mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
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:
parent
96aae8f6d5
commit
fd2c6d3d8c
1 changed files with 2 additions and 4 deletions
|
@ -3,15 +3,13 @@ require "../mocks"
|
||||||
module Spectator::DSL
|
module Spectator::DSL
|
||||||
macro double(name, &block)
|
macro double(name, &block)
|
||||||
{% if block.is_a?(Nop) %}
|
{% if block.is_a?(Nop) %}
|
||||||
Double{{name.id}}.new(self)
|
Double{{name.id}}.new
|
||||||
{% else %}
|
{% else %}
|
||||||
class Double{{name.id}} < ::Spectator::Mocks::Double
|
class Double{{name.id}} < ::Spectator::Mocks::Double
|
||||||
def initialize(@spectator_test : {{@type.id}})
|
def initialize
|
||||||
super({{name.id.symbolize}})
|
super({{name.id.symbolize}})
|
||||||
end
|
end
|
||||||
|
|
||||||
forward_missing_to @spectator_test
|
|
||||||
|
|
||||||
{{block.body}}
|
{{block.body}}
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
Loading…
Reference in a new issue