Parent

Class/Module Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::YieldSuccessiveArgs

Public Class Methods

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

Public Instance Methods

description() click to toggle source
# File lib/rspec/matchers/built_in/yield.rb, line 200
def description
  desc = "yield successive args"
  desc << "(" + @expected.map { |e| e.inspect }.join(", ") + ")"
  desc
end
failure_message_for_should() click to toggle source
# File lib/rspec/matchers/built_in/yield.rb, line 188
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
failure_message_for_should_not() click to toggle source
# File lib/rspec/matchers/built_in/yield.rb, line 194
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
matches?(block) click to toggle source
# File lib/rspec/matchers/built_in/yield.rb, line 182
def matches?(block)
  @probe = YieldProbe.probe(block)
  @actual = @probe.successive_yield_args
  args_match?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.