Revert "Fix methods not being stubbed with expect().to receive syntax"

This reverts commit 1c865d1f4b.
This commit is contained in:
Michael Miller 2021-07-10 13:21:21 -06:00
parent 06f9f380c9
commit a395e26bae
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -71,15 +71,11 @@ module Spectator::Mocks
end
def expect(object, stub : MethodStub) : Nil
entry = fetch_instance(object)
entry.expected.add(stub)
entry.stubs.unshift(stub)
fetch_instance(object).expected.add(stub)
end
def expect(type : T.class, stub : MethodStub) : Nil forall T
entry = fetch_type(type)
entry.expected.add(stub)
entry.stubs.unshift(stub)
fetch_type(type).expected.add(stub)
end
private def fetch_instance(object)