mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Store stubs in reverse order
This commit is contained in:
parent
17695d35cf
commit
0471794814
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,9 @@ module Spectator::Mocks
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_stub(object, stub : MethodStub) : Nil
|
def add_stub(object, stub : MethodStub) : Nil
|
||||||
fetch(object).stubs << stub
|
# Stubs are added in reverse order,
|
||||||
|
# so that later-defined stubs override previously defined ones.
|
||||||
|
fetch(object).stubs.unshift(stub)
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_stub(object, call : GenericMethodCall(T, NT)) forall T, NT
|
def find_stub(object, call : GenericMethodCall(T, NT)) forall T, NT
|
||||||
|
|
Loading…
Reference in a new issue