Method: RSpec::Matchers#yield_with_args
- Defined in:
- lib/rspec/matchers.rb
#yield_with_args(*args) ⇒ Object Also known as: a_block_yielding_with_args, yielding_with_args
Note:
Your expect block must accept a parameter and pass it on to the method-under-test as a block.
Note:
This matcher is not designed for use with methods that yield multiple times.
Given no arguments, matches if the method called in the expect block yields with arguments (regardless of what they are or how many there are).
Given arguments, matches if the method called in the expect block yields with arguments that match the given arguments.
Argument matching is done using ===
(the case match operator)
and ==
. If the expected and actual arguments match with either
operator, the matcher will pass.
919 920 921 |
# File 'lib/rspec/matchers.rb', line 919 def yield_with_args(*args) BuiltIn::YieldWithArgs.new(*args) end |