From 96aae8f6d5c6c1f975246a729af832e5f308ea3a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 10 Nov 2019 13:49:10 -0700 Subject: [PATCH] Use harness variable --- src/spectator/mocks/stubs.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spectator/mocks/stubs.cr b/src/spectator/mocks/stubs.cr index 092da34..a1c1423 100644 --- a/src/spectator/mocks/stubs.cr +++ b/src/spectator/mocks/stubs.cr @@ -47,7 +47,7 @@ module Spectator::Mocks %args = ::Spectator::Mocks::GenericArguments.create({{args.splat}}) %call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args) %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}}))) end end @@ -59,7 +59,7 @@ module Spectator::Mocks %args = ::Spectator::Mocks::GenericArguments.create({{args.splat}}) %call = ::Spectator::Mocks::GenericMethodCall.new({{name.symbolize}}, %args) %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 })) end end