class

Spectator::ValueStub(T)

Inherits Spectator::TypedStub / Spectator::Stub / Spectator::StubModifiers / Reference / Object

Stub that responds with a static value.

Constructors

new(method : Symbol, value : T, constraint : AbstractArguments | Nil = nil, location : Location | Nil = nil)

Creates the stub.

Source

Instance methods

call(call : MethodCall) : T

Invokes the stubbed implementation.

Source
to_s(io : IO) : Nil

String representation of the stub, formatted as a method call and return value.

Source
with_constraint(constraint : AbstractArguments | Nil)

Returns a new stub with constrained arguments.

Source