mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Ensure stubs defined with allow syntax are cleared
This commit is contained in:
parent
2516803b0d
commit
090c95b162
3 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
require "../harness"
|
||||
require "./stub"
|
||||
require "./stubbable"
|
||||
require "./stubbed_type"
|
||||
|
@ -21,6 +22,7 @@ module Spectator
|
|||
# Applies a stub to the targeted stubbable object.
|
||||
def to(stub : Stub) : Nil
|
||||
@target._spectator_define_stub(stub)
|
||||
Harness.current?.try &.cleanup { @target._spectator_remove_stub(stub) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue