mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix adding stubs to class methods on mocked types
This commit is contained in:
parent
5692a77a1b
commit
f1f1659836
2 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,10 @@ module Spectator::Mocks
|
|||
fetch_instance(object).stubs.unshift(stub)
|
||||
end
|
||||
|
||||
def add_stub(type : T.class, stub : MethodStub) : Nil forall T
|
||||
add_type_stub(type, stub)
|
||||
end
|
||||
|
||||
def add_type_stub(type, stub : MethodStub) : Nil
|
||||
fetch_type(type).stubs.unshift(stub)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue