module Spectator::StubModifiers
Overview
Mixin intended for Stub
to return new, modified stubs.
Direct including types
Defined in:
spectator/mocks/exception_stub.crspectator/mocks/multi_value_stub.cr
spectator/mocks/proc_stub.cr
spectator/mocks/stub_modifiers.cr
spectator/mocks/value_stub.cr
Instance Method Summary
-
#and_raise(exception_class : Exception.class, message)
Returns a new stub that raises an exception.
-
#and_raise(exception : Exception)
Returns a new stub that raises an exception.
-
#and_raise(message : String | Nil = nil)
Returns a new stub that raises an exception.
-
#and_raise(exception_class : Exception.class)
Returns a new stub that raises an exception.
-
#and_return(value)
Returns a new stub that returns a static value.
-
#and_return(value, *values)
Returns a new stub that returns multiple values in succession.
-
#with(constraint : AbstractArguments | Nil)
Returns a new stub of the same type with constrained arguments.
-
#with(*args, **kwargs)
Returns a new stub of the same type with constrained arguments.
-
#with(*args, **kwargs, &block : AbstractArguments -> T) forall T
Returns a new stub with an argument constraint.
-
#with_constraint(constraint : AbstractArguments | Nil)
Returns a new stub of the same type with constrained arguments.
Instance Method Detail
Returns a new stub that raises an exception.
Returns a new stub that raises an exception.
Returns a new stub of the same type with constrained arguments.
Returns a new stub with an argument constraint.
Returns a new stub of the same type with constrained arguments.