diff --git a/src/spectator/mocks/expect_any_instance.cr b/src/spectator/mocks/expect_any_instance.cr index c51c0e8..9d9769e 100644 --- a/src/spectator/mocks/expect_any_instance.cr +++ b/src/spectator/mocks/expect_any_instance.cr @@ -7,7 +7,7 @@ module Spectator::Mocks def to(stub : MethodStub) : Nil actual = TestValue.new(T) - Harness.current.mocks.expect(T, stub.name) + Harness.current.mocks.expect(T, stub) value = TestValue.new(stub.name, stub.to_s) matcher = Matchers::ReceiveTypeMatcher.new(value, stub.arguments?) partial = Expectations::ExpectationPartial.new(actual, @source)