mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use Registry for storing stubs
This commit is contained in:
parent
aa33acd14e
commit
fc0b46caca
1 changed files with 5 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
||||||
|
require "./registry"
|
||||||
|
|
||||||
module Spectator::Mocks
|
module Spectator::Mocks
|
||||||
struct Allow
|
struct Allow(T)
|
||||||
def initialize(@mock : Double)
|
def initialize(@mock : T)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to(stub : MethodStub) : Nil
|
def to(stub : MethodStub) : Nil
|
||||||
@mock.spectator_define_stub(stub)
|
Registry.add_stub(@mock, stub)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue