class RSpec::Matchers::BuiltIn::YieldWithArgs

Not intended to be instantiated directly.
Provides the implementation for ‘yield_with_args`.
@api private

def all_args_match?

def all_args_match?
  values_match?(@expected, @actual)
end

def args_currently_match?

def args_currently_match?
  if @expected.empty? # expect {...}.to yield_with_args
    @positive_args_failure = 'yielded with no arguments' if @actual.empty?
    return !@actual.empty?
  end
  unless (match = all_args_match?)
    @positive_args_failure = 'yielded with unexpected arguments' \
      "\nexpected: #{surface_descriptions_in(@expected).inspect}" \
      "\n     got: #{@actual_formatted}"
  end
  match
end

def description

Other tags:
    Private: -
def description
  desc = 'yield with args'
  desc = "#{desc}(#{expected_arg_description})" unless @expected.empty?
  desc
end

def does_not_match?(block)

Other tags:
    Private: -
def does_not_match?(block)
  !matches?(block) && @probe.has_block?
end

def expected_arg_description

def expected_arg_description
  @expected.map { |e| description_of e }.join(', ')
end

def failure_message

Other tags:
    Private: -
def failure_message
  "expected given block to yield with arguments, but #{positive_failure_reason}"
end

def failure_message_when_negated

Other tags:
    Private: -
def failure_message_when_negated
  "expected given block not to yield with arguments, but #{negative_failure_reason}"
end

def initialize(*args)

def initialize(*args)
  @expected = args
end

def matches?(block)

Other tags:
    Private: -
def matches?(block)
  @args_matched_when_yielded = true
  @probe = YieldProbe.new(block) do
    @actual = @probe.single_yield_args
    @actual_formatted = actual_formatted
    @args_matched_when_yielded &&= args_currently_match?
  end
  return false unless @probe.has_block?
  @probe.probe
  @probe.yielded_once?(:yield_with_args) && @args_matched_when_yielded
end

def negative_failure_reason

def negative_failure_reason
  if !@probe.has_block?
    'was not a block'
  elsif @args_matched_when_yielded && !@expected.empty?
    'yielded with expected arguments' \
      "\nexpected not: #{surface_descriptions_in(@expected).inspect}" \
      "\n         got: #{@actual_formatted}"
  else
    'did'
  end
end

def positive_failure_reason

def positive_failure_reason
  return 'was not a block' unless @probe.has_block?
  return 'did not yield' if @probe.num_yields.zero?
  @positive_args_failure
end

def supports_block_expectations?

Other tags:
    Private: -
def supports_block_expectations?
  true
end

def supports_value_expectations?

Other tags:
    Private: -
def supports_value_expectations?
  false
end