module

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_call_original

Modifies the stub to call the original method.

Source
and_raise(exception : Exception)

Modifies the stub to raise an exception.

Source
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.

Source
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.

Source
and_return(value)

Modifies the stub to return a value.

Source
and_return(value, *values)

Modifies the stub to return different values.

Source
and_return

Modifies the stub to return nil.

Source
with(*args, **kwargs)

Modifies the stub to only respond to the specified arguments.

Source
with(*args, **kwargs, &block : -> _)

Modifies the stub to only response to the specified arguments and invoke a block.

Source