class Mocha::Expectation
def multiple_yields(*parameter_groups)
- Example: Yield different groups of parameters on different invocations of the expected method. Simulating a situation where the CSV file at 'path/to/file.csv' has been modified between the two calls to +foreach+. -
Example: When +foreach+ is called, the stub will invoke the block twice, the first time it passes ['row1_col1', 'row1_col2'] as the parameters, and the second time it passes ['row2_col1', ''] as the parameters. -
Other tags:
- See: #then -
Returns:
-
(Expectation)
- the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
Parameters:
-
parameter_groups
(*Array
) -- each element of +parameter_groups+ should iself be an +Array+ representing the parameters to be passed to the block for a single yield. Any element of +parameter_groups+ that is not an +Array+ is wrapped in an +Array+.
def multiple_yields(*parameter_groups) @yield_parameters.add(*parameter_groups) self end