Method: RSpec::Matchers#yield_control

Defined in:
lib/rspec/matchers.rb

#yield_controlObject Also known as: a_block_yielding_control, yielding_control

Note:

Your expect block must accept a parameter and pass it on to the method-under-test as a block.

Passes if the method called in the expect block yields, regardless of whether or not arguments are yielded.

Examples:

expect { |b| 5.tap(&b) }.to yield_control
expect { |b| "a".to_sym(&b) }.not_to yield_control


871
872
873
# File 'lib/rspec/matchers.rb', line 871

def yield_control
  BuiltIn::YieldControl.new
end