mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use harness variable
This commit is contained in:
parent
6c0693f2a4
commit
96aae8f6d5
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ module Spectator::Mocks
|
||||||
%args = ::Spectator::Mocks::GenericArguments.create({{args.splat}})
|
%args = ::Spectator::Mocks::GenericArguments.create({{args.splat}})
|
||||||
%call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args)
|
%call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args)
|
||||||
%harness.mocks.record_call(self, %call)
|
%harness.mocks.record_call(self, %call)
|
||||||
if (%stub = ::Spectator::Harness.current.mocks.find_stub(self, %call))
|
if (%stub = %harness.mocks.find_stub(self, %call))
|
||||||
return %stub.call!(%args, typeof({{original}}({{args.splat}})))
|
return %stub.call!(%args, typeof({{original}}({{args.splat}})))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,7 @@ module Spectator::Mocks
|
||||||
%args = ::Spectator::Mocks::GenericArguments.create({{args.splat}})
|
%args = ::Spectator::Mocks::GenericArguments.create({{args.splat}})
|
||||||
%call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args)
|
%call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args)
|
||||||
%harness.mocks.record_call(self, %call)
|
%harness.mocks.record_call(self, %call)
|
||||||
if (%stub = ::Spectator::Harness.current.mocks.find_stub(self, %call))
|
if (%stub = %harness.mocks.find_stub(self, %call))
|
||||||
return %stub.call!(%args, typeof({{original}}({{args.splat}}) { |*%ya| yield *%ya }))
|
return %stub.call!(%args, typeof({{original}}({{args.splat}}) { |*%ya| yield *%ya }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue