# File lib/rspec/matchers/built_in/yield.rb, line 89 def failure_message_for_should "expected given block to yield with no arguments, but #{failure_reason}" end
# File lib/rspec/matchers/built_in/yield.rb, line 93 def failure_message_for_should_not "expected given block not to yield with no arguments, but did" end
# File lib/rspec/matchers/built_in/yield.rb, line 84 def matches?(block) @probe = YieldProbe.probe(block) @probe.yielded_once?(:yield_with_no_args) && @probe.single_yield_args.none? end
# File lib/rspec/matchers/built_in/yield.rb, line 99 def failure_reason if @probe.num_yields.zero? "did not yield" else "yielded with arguments: #{@probe.single_yield_args.inspect}" end end