diff --git a/src/spectator/mocks/exception_stub.cr b/src/spectator/mocks/exception_stub.cr index af92777..c4ce361 100644 --- a/src/spectator/mocks/exception_stub.cr +++ b/src/spectator/mocks/exception_stub.cr @@ -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 diff --git a/src/spectator/mocks/multi_value_stub.cr b/src/spectator/mocks/multi_value_stub.cr index 8e1a403..573a418 100644 --- a/src/spectator/mocks/multi_value_stub.cr +++ b/src/spectator/mocks/multi_value_stub.cr @@ -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 diff --git a/src/spectator/mocks/null_stub.cr b/src/spectator/mocks/null_stub.cr index 8c2d6d3..c1f3594 100644 --- a/src/spectator/mocks/null_stub.cr +++ b/src/spectator/mocks/null_stub.cr @@ -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 diff --git a/src/spectator/mocks/proc_stub.cr b/src/spectator/mocks/proc_stub.cr index d20cc9c..c62e566 100644 --- a/src/spectator/mocks/proc_stub.cr +++ b/src/spectator/mocks/proc_stub.cr @@ -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 diff --git a/src/spectator/mocks/stub_modifiers.cr b/src/spectator/mocks/stub_modifiers.cr index bb7662c..9daf2af 100644 --- a/src/spectator/mocks/stub_modifiers.cr +++ b/src/spectator/mocks/stub_modifiers.cr @@ -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 diff --git a/src/spectator/mocks/value_stub.cr b/src/spectator/mocks/value_stub.cr index 5783a5a..cd7f6d2 100644 --- a/src/spectator/mocks/value_stub.cr +++ b/src/spectator/mocks/value_stub.cr @@ -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