mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix arg passing and implement arg matching
This commit is contained in:
parent
1756670710
commit
e6c1a6b2d2
2 changed files with 7 additions and 2 deletions
|
@ -16,7 +16,7 @@ module Spectator::Mocks
|
|||
dispatcher.call(*@args, **@opts)
|
||||
end
|
||||
|
||||
def ===(other : Arguments(U, NU)) : Bool forall U, NU
|
||||
def ===(other : GenericArguments(U, NU)) : Bool forall U, NU
|
||||
return false unless @args === other.args
|
||||
return false unless @opts.size === other.opts.size
|
||||
|
||||
|
|
|
@ -13,7 +13,12 @@ module Spectator::Mocks
|
|||
end
|
||||
|
||||
def and_return(value : T) forall T
|
||||
ValueMethodStub.new(@name, @source, value)
|
||||
ValueMethodStub.new(@name, @source, value, @args)
|
||||
end
|
||||
|
||||
def with(*args : *T, **opts : **NT) forall T, NT
|
||||
args = GenericArguments.new(args, opts)
|
||||
NilMethodStub.new(@name, @source, args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue