mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
No need to specify arguments to super and previous_def
This commit is contained in:
parent
288268279d
commit
e2c2ebafd3
1 changed files with 7 additions and 7 deletions
|
@ -61,16 +61,16 @@ module Spectator::Mocks
|
||||||
%call = ::Spectator::Mocks::MethodCall.new({{name.symbolize}}, %args)
|
%call = ::Spectator::Mocks::MethodCall.new({{name.symbolize}}, %args)
|
||||||
%harness.mocks.record_call(self, %call)
|
%harness.mocks.record_call(self, %call)
|
||||||
if (%stub = %harness.mocks.find_stub(self, %call))
|
if (%stub = %harness.mocks.find_stub(self, %call))
|
||||||
return %stub.call!(%args) { {{original}}({{args.splat}}) }
|
return %stub.call!(%args) { {{original}} }
|
||||||
end
|
end
|
||||||
|
|
||||||
{% if body && !body.is_a?(Nop) %}
|
{% if body && !body.is_a?(Nop) %}
|
||||||
%method({{args.splat}})
|
%method({{args.splat}})
|
||||||
{% else %}
|
{% else %}
|
||||||
{{original}}({{args.splat}})
|
{{original}}
|
||||||
{% end %}
|
{% end %}
|
||||||
else
|
else
|
||||||
{{original}}({{args.splat}})
|
{{original}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -80,18 +80,18 @@ module Spectator::Mocks
|
||||||
%call = ::Spectator::Mocks::MethodCall.new({{name.symbolize}}, %args)
|
%call = ::Spectator::Mocks::MethodCall.new({{name.symbolize}}, %args)
|
||||||
%harness.mocks.record_call(self, %call)
|
%harness.mocks.record_call(self, %call)
|
||||||
if (%stub = %harness.mocks.find_stub(self, %call))
|
if (%stub = %harness.mocks.find_stub(self, %call))
|
||||||
return %stub.call!(%args) { {{original}}({{args.splat}}) { |*%ya| yield *%ya } }
|
return %stub.call!(%args) { {{original}} { |*%ya| yield *%ya } }
|
||||||
end
|
end
|
||||||
|
|
||||||
{% if body && !body.is_a?(Nop) %}
|
{% if body && !body.is_a?(Nop) %}
|
||||||
%method({{args.splat}}) { {{original}}({{args.splat}}) { |*%ya| yield *%ya } }
|
%method({{args.splat}}) { {{original}} { |*%ya| yield *%ya } }
|
||||||
{% else %}
|
{% else %}
|
||||||
{{original}}({{args.splat}}) do |*%yield_args|
|
{{original}} do |*%yield_args|
|
||||||
yield *%yield_args
|
yield *%yield_args
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
else
|
else
|
||||||
{{original}}({{args.splat}}) do |*%yield_args|
|
{{original}} do |*%yield_args|
|
||||||
yield *%yield_args
|
yield *%yield_args
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue