module Spectator::Mocks::StubModifiers
Overview
Modifiers used to change the behavior of a stub applied to a method. This makes up part of the fluent interface for the DSL.
Direct including types
Defined in:
spectator/mocks/stub_modifiers.crInstance Method Summary
-
#and_raise(exception : Exception)
Modifies the stub to raise an exception.
-
#and_raise(message : String | Nil = nil)
Modifies the stub to raise an exception.
-
#and_raise(exception_type : Exception.class, *args, **kwargs)
Modifies the stub to raise an exception.
-
#and_return(value)
Modifies the stub to return a value.
-
#with(*args, **kwargs)
Modifies the stub to only respond to the specified arguments.
-
#with(*args, **kwargs, &block : -> _)
Modifies the stub to only response to the specified arguments and invoke a block.
Instance Method Detail
Modifies the stub to raise an exception.
A RuntimeError
with the specified message will be raised when the stub is called.
Modifies the stub to raise an exception. Creates a new exception of the specified type and forwards additional arguments to it.
Modifies the stub to only response to the specified arguments and invoke a block.