class RSpec::Matchers::BuiltIn::YieldSuccessiveArgs
def args_match?
def args_match? return false if @expected.size != @actual.size @expected.zip(@actual).all? do |expected, actual| expected === actual || actual == expected end end
def description
def description desc = "yield successive args" desc << "(" + @expected.map { |e| e.inspect }.join(", ") + ")" desc end
def failure_message_for_should
def failure_message_for_should "expected given block to yield successively with arguments, but yielded with unexpected arguments" + "\nexpected: #{@expected.inspect}" + "\n got: #{@actual.inspect} (compared using === and ==)" end
def failure_message_for_should_not
def failure_message_for_should_not "expected given block not to yield successively with arguments, but yielded with expected arguments" + "\nexpected not: #{@expected.inspect}" + "\n got: #{@actual.inspect} (compared using === and ==)" end
def initialize(*args)
def initialize(*args) @expected = args end
def matches?(block)
def matches?(block) @probe = YieldProbe.probe(block) @actual = @probe.successive_yield_args args_match? end
def supports_block_expectations?
- Private: -
def supports_block_expectations? true end