module

Spectator::StubModifiers

Mixin intended for Stub to return new, modified stubs.

Instance methods

and_raise(exception_class : Exception.class, message)

Returns a new stub that raises an exception.

Source
and_raise(exception : Exception)

Returns a new stub that raises an exception.

Source
and_raise(message : String | Nil = nil)

Returns a new stub that raises an exception.

Source
and_raise(exception_class : Exception.class)

Returns a new stub that raises an exception.

Source
and_return(value)

Returns a new stub that returns a static value.

Source
and_return(value, *values)

Returns a new stub that returns multiple values in succession.

Source
with(constraint : AbstractArguments | Nil)

Returns a new stub of the same type with constrained arguments.

Source
with(*args, **kwargs)

Returns a new stub of the same type with constrained arguments.

Source
with(*args, **kwargs, &block : AbstractArguments -> T) forall T

Returns a new stub with an argument constraint.

Source
with_constraint(constraint : AbstractArguments | Nil)

Returns a new stub of the same type with constrained arguments.

Source