class RSpec::Matchers::BuiltIn::YieldControl
@api private Provides the implementation for ‘yield_control`. Not intended to be instantiated directly.
Public Instance Methods
Source
# File lib/rspec/matchers/built_in/yield.rb, line 111 def does_not_match?(block) !matches?(block) && @probe.has_block? end
@private
Source
# File lib/rspec/matchers/built_in/yield.rb, line 117 def failure_message 'expected given block to yield control' + failure_reason end
@api private @return [String]
Source
# File lib/rspec/matchers/built_in/yield.rb, line 123 def failure_message_when_negated 'expected given block not to yield control' + failure_reason end
@api private @return [String]
Source
# File lib/rspec/matchers/built_in/yield.rb, line 104 def matches?(block) @probe = YieldProbe.probe(block) return false unless @probe.has_block? expected_count_matches?(@probe.num_yields) end
@private
Source
# File lib/rspec/matchers/built_in/yield.rb, line 128 def supports_block_expectations? true end
@private
Source
# File lib/rspec/matchers/built_in/yield.rb, line 133 def supports_value_expectations? false end
@private
Private Instance Methods
Source
# File lib/rspec/matchers/built_in/yield.rb, line 139 def failure_reason return ' but was not a block' unless @probe.has_block? return "#{count_expectation_description} but did not yield" if @probe.num_yields == 0 count_failure_reason('yielded') end