mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename with
method to avoid recursive splat and ambiguity
This commit is contained in:
parent
011ca37b50
commit
4f46c98a86
6 changed files with 8 additions and 8 deletions
|
@ -12,7 +12,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Returns a new stub with constrained arguments.
|
||||
def with(constraint : AbstractArguments)
|
||||
def with_constraint(constraint : AbstractArguments)
|
||||
self.class.new(method, @exception, constraint, location)
|
||||
end
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Returns a new stub with constrained arguments.
|
||||
def with(constraint : AbstractArguments)
|
||||
def with_constraint(constraint : AbstractArguments)
|
||||
self.class.new(method, @values, constraint, location)
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Returns a new stub with constrained arguments.
|
||||
def with(constraint : AbstractArguments)
|
||||
def with_constraint(constraint : AbstractArguments)
|
||||
self.class.new(method, constraint, location)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Returns a new stub with constrained arguments.
|
||||
def with(constraint : AbstractArguments)
|
||||
def with_constraint(constraint : AbstractArguments)
|
||||
self.class.new(method, @proc, constraint, location)
|
||||
end
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ module Spectator
|
|||
# Mixin intended for `Stub` to return new, modified stubs.
|
||||
module StubModifiers
|
||||
# Returns a new stub of the same type with constrained arguments.
|
||||
abstract def with(constraint : AbstractArguments)
|
||||
abstract def with_constraint(constraint : AbstractArguments)
|
||||
|
||||
# :ditto:
|
||||
def with(*args, **kwargs)
|
||||
constraint = Arguments.new(args, kwargs)
|
||||
self.with(constraint)
|
||||
constraint = Arguments.new(args, kwargs).as(AbstractArguments)
|
||||
self.with_constraint(constraint)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Returns a new stub with constrained arguments.
|
||||
def with(constraint : AbstractArguments)
|
||||
def with_constraint(constraint : AbstractArguments)
|
||||
self.class.new(method, @value, constraint, location)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue