Method: Mocha::Expectation#yields
- Defined in:
- lib/mocha/expectation.rb
#yields(*parameters) ⇒ Expectation
Modifies expectation so that when the expected method is called, it yields to the block with the specified parameters.
If no parameters are specified, it yields to the block without any parameters.
If no block is provided, the method will still attempt to yield resulting in a LocalJumpError. Note that this is what would happen if a “real” (non-mock) method implementation tried to yield to a non-existent block.
May be called multiple times on the same expectation for consecutive invocations.
347 348 349 |
# File 'lib/mocha/expectation.rb', line 347 def yields(*parameters) multiple_yields(parameters) end |