module 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:
mocks/stub_modifiers.crInstance Method Summary
-
#and_call_original
Modifies the stub to call the original method.
-
#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.
-
#and_return(value, *values)
Modifies the stub to return different values.
-
#and_return
Modifies the stub to return nil.
-
#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.