class Mocha::Expectation
def returns(*values)
- Example: Note that in Ruby a method returning multiple values is exactly equivalent to a method returning an +Array+ of those values. -
Example: May be called in conjunction with {#raises} on the same expectation. -
Example: Alternative way to return a different value on consecutive invocations. -
Example: Return a different value on consecutive invocations. -
Example: Return the same value on every invocation. -
Parameters:
-
values
(*Array
) -- values to return on consecutive invocations of expected method. -
value
(Object
) -- value to return on invocation of expected method.
Overloads:
-
def returns(*values)
-
def returns(value)
Other tags:
- See: #then -
Returns:
-
(Expectation)
- the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
def returns(*values) @return_values += ReturnValues.build(*values) self end