Fix possible shadowing of mock

This commit is contained in:
Michael Miller 2022-07-12 19:50:04 -06:00
parent 6e57a1c44a
commit bb0c85d9ec
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF

View file

@ -286,10 +286,10 @@ module Spectator::DSL
found_tuple = found_tuples.last %} found_tuple = found_tuples.last %}
{% if found_tuple %} {% if found_tuple %}
{{found_tuple[2].id}}.new.tap do |mock| {{found_tuple[2].id}}.new.tap do |%mock|
{% for key, value in value_methods %} {% for key, value in value_methods %}
%stub{key} = ::Spectator::ValueStub.new({{key.id.symbolize}}, {{value}}) %stub{key} = ::Spectator::ValueStub.new({{key.id.symbolize}}, {{value}})
mock._spectator_define_stub(%stub{key}) %mock._spectator_define_stub(%stub{key})
{% end %} {% end %}
end end
{% else %} {% else %}
@ -362,10 +362,10 @@ module Spectator::DSL
found_tuple = found_tuples.last %} found_tuple = found_tuples.last %}
{% if found_tuple %} {% if found_tuple %}
{{found_tuple[2].id}}.tap do |mock| {{found_tuple[2].id}}.tap do |%mock|
{% for key, value in value_methods %} {% for key, value in value_methods %}
%stub{key} = ::Spectator::ValueStub.new({{key.id.symbolize}}, {{value}}) %stub{key} = ::Spectator::ValueStub.new({{key.id.symbolize}}, {{value}})
mock._spectator_define_stub(%stub{key}) %mock._spectator_define_stub(%stub{key})
{% end %} {% end %}
end end
{% else %} {% else %}