class Mocks::CallOriginalStub
- Mocks::CallOriginalStub
- Mocks::Stub
- Reference
- Object
Overview
Stub that calls the original method and returns its return value.
Defined in:
mocks/call_original_stub.crInstance Method Summary
-
#call(args : Args, return_type : U.class = Nil) forall Args, U
Invokes the stub.
-
#handled?
Indicates whether the stub can handle a method call.
Instance methods inherited from class Mocks::Stub
===(call : Call) : Bool
===,
arguments : AbstractArgumentsPattern | Nil
arguments,
call(args : Args, return_type : U.class = Nil) forall Args, U
call,
handled?
handled?,
method_name : Symbol
method_name,
to_s(io : IO) : Nil
to_s
Constructor methods inherited from class Mocks::Stub
new(method_name : Symbol, arguments : AbstractArgumentsPattern | Nil = nil)
new
Instance methods inherited from module Mocks::StubModifiers
and_call_original
and_call_original,
and_raise(exception : Exception)and_raise(message : String | Nil = nil)
and_raise(exception_type : Exception.class, *args, **kwargs) and_raise, and_return(value)
and_return(value, *values)
and_return and_return, with(*args, **kwargs)
with(*args, **kwargs, &block : -> _) with
Instance Method Detail
Description copied from class Mocks::Stub
Invokes the stub. args are the arguments passed to the method call. The return_type indicates the type expected to be returned by the stub. The type returned by this method must match return_type.
def handled?
#
Description copied from class Mocks::Stub
Indicates whether the stub can handle a method call. Returns false if a stubbable object should use its default behavior (i.e. the original method).