Parent

Included Modules

Class/Module Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::YieldWithArgs

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

Public Class Methods

new(*args) click to toggle source
# File lib/rspec/matchers/built_in/yield.rb, line 247
def initialize(*args)
  @expected = args
end

Public Instance Methods

description() click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 275
def description
  desc = "yield with args"
  desc << "(#{expected_arg_description})" unless @expected.empty?
  desc
end
does_not_match?(block) click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 260
def does_not_match?(block)
  !matches?(block) && @probe.has_block?
end
failure_message() click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 265
def failure_message
  "expected given block to yield with arguments, but #{positive_failure_reason}"
end
failure_message_when_negated() click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 270
def failure_message_when_negated
  "expected given block not to yield with arguments, but #{negative_failure_reason}"
end
matches?(block) click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 252
def matches?(block)
  @probe = YieldProbe.probe(block)
  return false unless @probe.has_block?
  @actual = @probe.single_yield_args
  @probe.yielded_once?(:yield_with_args) && args_match?
end
supports_block_expectations?() click to toggle source

@private

# File lib/rspec/matchers/built_in/yield.rb, line 282
def supports_block_expectations?
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.