class Spectator::MultiValueStub(T)

Overview

Stub that responds with a multiple values in succession.

Defined in:

spectator/mocks/multi_value_stub.cr

Constructors

Instance Method Summary

Instance methods inherited from class Spectator::TypedStub(T)

call(call : MethodCall) : T call

Constructor methods inherited from class Spectator::TypedStub(T)

new(method : Symbol, constraint : AbstractArguments? = nil, location : Location? = nil) new

Instance methods inherited from class Spectator::Stub

===(call : MethodCall) ===, constraint : AbstractArguments? constraint, location : Location? location, method : Symbol method, to_s(io : IO) : Nil to_s

Constructor methods inherited from class Spectator::Stub

new(method : Symbol, constraint : AbstractArguments? = nil, location : Location? = nil) new

Instance methods inherited from module Spectator::StubModifiers

and_raise(exception_class : Exception.class, message)
and_raise(exception : Exception)
and_raise(message : String? = nil)
and_raise(exception_class : Exception.class)
and_raise
, and_return(value)
and_return(value, *values)
and_return
, with(constraint : AbstractArguments?)
with(*args, **kwargs)
with(*args, **kwargs, &block : AbstractArguments -> T) forall T
with
, with_constraint(constraint : AbstractArguments?) with_constraint

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Constructor Detail

def self.new(method : Symbol, values : Array(T), constraint : AbstractArguments? = nil, location : Location? = nil) #

Creates the stub.


[View source]

Instance Method Detail

def call(call : MethodCall) : T #

Invokes the stubbed implementation.


[View source]
def with_constraint(constraint : AbstractArguments?) #

Returns a new stub with constrained arguments.


[View source]