Parent

Class Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::YieldSuccessiveArgs

Public Class Methods

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

Public Instance Methods

description() click to toggle source
     # File lib/rspec/matchers/built_in/yield.rb, line 203
203:         def description
204:           desc = "yield successive args"
205:           desc << "(" + @expected.map { |e| e.inspect }.join(", ") + ")"
206:           desc
207:         end
failure_message_for_should() click to toggle source
     # File lib/rspec/matchers/built_in/yield.rb, line 191
191:         def failure_message_for_should
192:           "expected given block to yield successively with arguments, but yielded with unexpected arguments" +
193:             "\nexpected: #{@expected.inspect}" +
194:             "\n     got: #{@actual.inspect} (compared using === and ==)"
195:         end
failure_message_for_should_not() click to toggle source
     # File lib/rspec/matchers/built_in/yield.rb, line 197
197:         def failure_message_for_should_not
198:           "expected given block not to yield successively with arguments, but yielded with expected arguments" +
199:               "\nexpected not: #{@expected.inspect}" +
200:               "\n         got: #{@actual.inspect} (compared using === and ==)"
201:         end
matches?(block) click to toggle source
     # File lib/rspec/matchers/built_in/yield.rb, line 185
185:         def matches?(block)
186:           @probe = YieldProbe.probe(block)
187:           @actual = @probe.successive_yield_args
188:           args_match?
189:         end

Private Instance Methods

args_match?() click to toggle source
     # File lib/rspec/matchers/built_in/yield.rb, line 211
211:         def args_match?
212:           return false if @expected.size != @actual.size
213: 
214:           @expected.zip(@actual).all? do |expected, actual|
215:             expected === actual || actual == expected
216:           end
217:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.