Add stubs in reverse order

This commit is contained in:
Michael Miller 2019-11-10 13:04:28 -07:00
parent 4fea5ea435
commit 2bc4f71edb

View file

@ -51,7 +51,7 @@ module Spectator::SpecBuilder
def add_default_stub(type : T.class, stub : Mocks::MethodStub) forall T def add_default_stub(type : T.class, stub : Mocks::MethodStub) forall T
key = type.name key = type.name
@default_stubs[key] = Deque(Mocks::MethodStub).new unless @default_stubs.has_key?(key) @default_stubs[key] = Deque(Mocks::MethodStub).new unless @default_stubs.has_key?(key)
@default_stubs[key] << stub @default_stubs[key].unshift(stub)
end end
private def build_hooks private def build_hooks