Use Registry for storing stubs

This commit is contained in:
Michael Miller 2019-11-09 09:08:09 -07:00
parent aa33acd14e
commit fc0b46caca

View file

@ -1,10 +1,12 @@
require "./registry"
module Spectator::Mocks
struct Allow
def initialize(@mock : Double)
struct Allow(T)
def initialize(@mock : T)
end
def to(stub : MethodStub) : Nil
@mock.spectator_define_stub(stub)
Registry.add_stub(@mock, stub)
end
end
end