disu.se

ReceptionClass

Namespace

Lookout

Ancestors
  1. Value

  2. Object

Method reception expectation builder. Method reception expectations can set expectations on what method is going to be called, with what arguments, and how many times it’s to take place.

Children

Arguments

Arguments that should be passed to a method reception expectation.

Error

Error raised when a method is received too many times.

Class Methods

of(objectObject, methodSymbol, *argsObject*, &bodyProc)Lookout::Reception#

Returns a reception expectation expecting method to be called on object with args, using body as the method definition.

Instance Methods

never#

This is an alias for #exactly(0).

at_most_once#

This is an alias for #at_most(1).

once#

This is an alias for #exactly(1).

at_least_once#

This is an alias for #at_least(1).

twice#

This is an alias for #exactly(2).

at_most(timesInteger)Lookout::Reception#

Returns a reception expectation with a maximum number of times that the method may be called.

RaisesArgumentError

If times < 1

exactly(timesInteger)Lookout::Reception#

Returns a reception expectation with a minimum and maximum number of times that the method may be called.

RaisesArgumentError

If times < 0

at_least(timesInteger)#

Sets the minimum number of times that the method may be called.

ReturnsLookout::Reception

A reception expectation with a minimum number of times that the method may be called

RaisesArgumentError

If times < 1

to_lookout_expectedExpected::Lookout::Reception#

Returns a wrapper around the object that represents the expected reception of this method.

block(&blockProc)Proc#

Returns a block to be used by Expected::Lookout::Reception#expect that’ll set up a stub for the expected method reception that’ll check that the call count doesn’t exceed any upper limit imposed upon it and verify that any arguments are what they’re expected to be and then invoke block.

to_sString#

Returns a String consisting of the inspection of the object, followed by either ‘.’ or ‘#’ depending on whether the object is a Class or not, and the method name.