@api private Provides the implementation for `yield_control`. Not intended to be instantiated directly.
@api public Specifies the minimum number of times the method is expected to yield
# File lib/rspec/matchers/built_in/yield.rb, line 117 def at_least(number) set_expected_yields_count(:>=, number) self end
@api public Specifies the maximum number of times the method is expected to yield
# File lib/rspec/matchers/built_in/yield.rb, line 110 def at_most(number) set_expected_yields_count(:<=, number) self end
@private
# File lib/rspec/matchers/built_in/yield.rb, line 141 def does_not_match?(block) !matches?(block) && @probe.has_block? end
@api public Specifies that the method is expected to yield the given number of times.
# File lib/rspec/matchers/built_in/yield.rb, line 103 def exactly(number) set_expected_yields_count(:==, number) self end
@api private @return [String]
# File lib/rspec/matchers/built_in/yield.rb, line 147 def failure_message 'expected given block to yield control' + failure_reason end
@api private @return [String]
# File lib/rspec/matchers/built_in/yield.rb, line 153 def failure_message_when_negated 'expected given block not to yield control' + failure_reason end
@private
# File lib/rspec/matchers/built_in/yield.rb, line 129 def matches?(block) @probe = YieldProbe.probe(block) return false unless @probe.has_block? if @expectation_type @probe.num_yields.__send__(@expectation_type, @expected_yields_count) else @probe.yielded_once?(:yield_control) end end
@api public Specifies that the method is expected to yield once.
# File lib/rspec/matchers/built_in/yield.rb, line 89 def once exactly(1) self end
@private
# File lib/rspec/matchers/built_in/yield.rb, line 158 def supports_block_expectations? true end
Generated with the Darkfish Rdoc Generator 2.