class Spectator::NullStub
Overview
Stub that does nothing and returns nil.
Defined in:
spectator/mocks/null_stub.crConstructors
-
.new(method : Symbol, constraint : AbstractArguments | Nil = nil, location : Location | Nil = nil)
Creates the base of the stub.
Instance Method Summary
-
#call(call : MethodCall) : Nil
Invokes the stubbed implementation.
-
#with_constraint(constraint : AbstractArguments | Nil)
Returns a new stub with constrained arguments.
Instance methods inherited from class Spectator::TypedStub(Nil)
call(call : MethodCall) : T
call
Constructor methods inherited from class Spectator::TypedStub(Nil)
new(method : Symbol, constraint : AbstractArguments | Nil = nil, location : Location | Nil = nil)
new
Instance methods inherited from class Spectator::Stub
===(call : MethodCall)
===,
constraint : AbstractArguments | Nil
constraint,
location : Location | Nil
location,
method : Symbol
method,
to_s(io : IO) : Nil
to_s
Constructor methods inherited from class Spectator::Stub
new(method : Symbol, constraint : AbstractArguments | Nil = nil, location : Location | Nil = 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 = nil)
and_raise(exception_class : Exception.class) and_raise, and_return(value)
and_return(value, *values) and_return, with(constraint : AbstractArguments | Nil)
with(*args, **kwargs)
with(*args, **kwargs, &block : AbstractArguments -> T) forall T with, with_constraint(constraint : AbstractArguments | Nil) 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, constraint : AbstractArguments | Nil = nil, location : Location | Nil = nil)
#
Creates the base of the stub.
Instance Method Detail
def with_constraint(constraint : AbstractArguments | Nil)
#
Returns a new stub with constrained arguments.