mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Revert "Fix methods not being stubbed with expect().to receive
syntax"
This reverts commit 1c865d1f4b
.
This commit is contained in:
parent
06f9f380c9
commit
a395e26bae
1 changed files with 2 additions and 6 deletions
|
@ -71,15 +71,11 @@ module Spectator::Mocks
|
||||||
end
|
end
|
||||||
|
|
||||||
def expect(object, stub : MethodStub) : Nil
|
def expect(object, stub : MethodStub) : Nil
|
||||||
entry = fetch_instance(object)
|
fetch_instance(object).expected.add(stub)
|
||||||
entry.expected.add(stub)
|
|
||||||
entry.stubs.unshift(stub)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def expect(type : T.class, stub : MethodStub) : Nil forall T
|
def expect(type : T.class, stub : MethodStub) : Nil forall T
|
||||||
entry = fetch_type(type)
|
fetch_type(type).expected.add(stub)
|
||||||
entry.expected.add(stub)
|
|
||||||
entry.stubs.unshift(stub)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private def fetch_instance(object)
|
private def fetch_instance(object)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue