Mocks::StubModifiers
Modifiers used to change the behavior of a stub applied to a method. This makes up part of the fluent interface for the DSL.
Instance methods
and_raise(message : String | Nil = nil)
Modifies the stub to raise an exception.
A RuntimeError with the specified message will be raised when the stub is called.
and_raise(exception_type : Exception.class, *args, **kwargs)
Modifies the stub to raise an exception. Creates a new exception of the specified type and forwards additional arguments to it.
with(*args, **kwargs, &block : -> _)
Modifies the stub to only response to the specified arguments and invoke a block.