mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix reflection (verify double) on self arg type
There is still an issue with using _ for a placeholder.
This commit is contained in:
parent
16625cf495
commit
8ccc08b472
1 changed files with 11 additions and 2 deletions
|
@ -7,10 +7,19 @@ module Spectator::Mocks
|
|||
%source = ::Spectator::Source.new({{meth.filename}}, {{meth.line_number}})
|
||||
%args = ::Spectator::Mocks::GenericArguments.create(
|
||||
{% for arg, i in meth.args %}
|
||||
{% matcher = if arg.restriction
|
||||
if arg.restriction == :self.id
|
||||
@type.id
|
||||
else
|
||||
arg.restriction
|
||||
end
|
||||
else
|
||||
"::Spectator::Anything.new".id
|
||||
end %}
|
||||
{% if meth.splat_index && i == meth.splat_index %}
|
||||
*{{arg.restriction || "::Spectator::Anything.new".id}}{% if i < meth.args.size %},{% end %}
|
||||
*{{matcher}}{% if i < meth.args.size %},{% end %}
|
||||
{% else %}
|
||||
{{arg.restriction || "::Spectator::Anything.new".id}}{% if i < meth.args.size %},{% end %}
|
||||
{{matcher}}{% if i < meth.args.size %},{% end %}
|
||||
{% end %}
|
||||
{% end %}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue