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
|
end
|
||||||
|
|
||||||
# Returns a new stub with constrained arguments.
|
# Returns a new stub with constrained arguments.
|
||||||
def with(constraint : AbstractArguments)
|
def with_constraint(constraint : AbstractArguments)
|
||||||
self.class.new(method, @exception, constraint, location)
|
self.class.new(method, @exception, constraint, location)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a new stub with constrained arguments.
|
# Returns a new stub with constrained arguments.
|
||||||
def with(constraint : AbstractArguments)
|
def with_constraint(constraint : AbstractArguments)
|
||||||
self.class.new(method, @values, constraint, location)
|
self.class.new(method, @values, constraint, location)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a new stub with constrained arguments.
|
# Returns a new stub with constrained arguments.
|
||||||
def with(constraint : AbstractArguments)
|
def with_constraint(constraint : AbstractArguments)
|
||||||
self.class.new(method, constraint, location)
|
self.class.new(method, constraint, location)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a new stub with constrained arguments.
|
# Returns a new stub with constrained arguments.
|
||||||
def with(constraint : AbstractArguments)
|
def with_constraint(constraint : AbstractArguments)
|
||||||
self.class.new(method, @proc, constraint, location)
|
self.class.new(method, @proc, constraint, location)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ module Spectator
|
||||||
# Mixin intended for `Stub` to return new, modified stubs.
|
# Mixin intended for `Stub` to return new, modified stubs.
|
||||||
module StubModifiers
|
module StubModifiers
|
||||||
# Returns a new stub of the same type with constrained arguments.
|
# Returns a new stub of the same type with constrained arguments.
|
||||||
abstract def with(constraint : AbstractArguments)
|
abstract def with_constraint(constraint : AbstractArguments)
|
||||||
|
|
||||||
# :ditto:
|
# :ditto:
|
||||||
def with(*args, **kwargs)
|
def with(*args, **kwargs)
|
||||||
constraint = Arguments.new(args, kwargs)
|
constraint = Arguments.new(args, kwargs).as(AbstractArguments)
|
||||||
self.with(constraint)
|
self.with_constraint(constraint)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a new stub with constrained arguments.
|
# Returns a new stub with constrained arguments.
|
||||||
def with(constraint : AbstractArguments)
|
def with_constraint(constraint : AbstractArguments)
|
||||||
self.class.new(method, @value, constraint, location)
|
self.class.new(method, @value, constraint, location)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue