class RSpec::Matchers::BuiltIn::YieldControl
Not intended to be instantiated directly.
Provides the implementation for ‘yield_control`.
@api private
def does_not_match?(block)
- Private: -
def does_not_match?(block) !matches?(block) && @probe.has_block? end
def failure_message
-
(String)
-
Other tags:
- Api: - private
def failure_message 'expected given block to yield control' + failure_reason end
def failure_message_when_negated
-
(String)
-
Other tags:
- Api: - private
def failure_message_when_negated 'expected given block not to yield control' + failure_reason end
def failure_reason
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
def matches?(block)
- Private: -
def matches?(block) @probe = YieldProbe.probe(block) return false unless @probe.has_block? expected_count_matches?(@probe.num_yields) end
def supports_block_expectations?
- Private: -
def supports_block_expectations? true end
def supports_value_expectations?
- Private: -
def supports_value_expectations? false end