Parent

FlexMock::CompositeExpectation

                                                                        

A composite expectation allows several expectations to be grouped into a single composite and then apply the same constraints to all expectations in the group.

Public Class Methods

new() click to toggle source

Initialize the composite expectation.

     # File lib/flexmock/expectation.rb, line 402
402:     def initialize
403:       @expectations = []
404:     end

Public Instance Methods

add(expectation) click to toggle source

Add an expectation to the composite.

     # File lib/flexmock/expectation.rb, line 407
407:     def add(expectation)
408:       @expectations << expectation
409:     end
method_missing(sym, *args, &block) click to toggle source

Apply the constraint method to all expectations in the composite.

     # File lib/flexmock/expectation.rb, line 412
412:     def method_missing(sym, *args, &block)
413:       @expectations.each do |expectation|
414:         expectation.send(sym, *args, &block)
415:       end
416:       self
417:     end
mock() click to toggle source

Return the associated mock object.

     # File lib/flexmock/expectation.rb, line 428
428:     def mock
429:       @expectations.first.mock
430:     end
order_number() click to toggle source

Return the order number of the first expectation in the list.

     # File lib/flexmock/expectation.rb, line 423
423:     def order_number
424:       @expectations.first.order_number
425:     end
should_receive(*args, &block) click to toggle source

Start a new method expectation. The following constraints will be applied to the new expectation.

     # File lib/flexmock/expectation.rb, line 434
434:     def should_receive(*args, &block)
435:       @expectations.first.mock.should_receive(*args, &block)
436:     end
to_s() click to toggle source

Return a string representations

     # File lib/flexmock/expectation.rb, line 439
439:     def to_s
440:       if @expectations.size > 1
441:         "[" + @expectations.collect { |e| e.to_s }.join(', ') + "]"
442:       else
443:         @expectations.first.to_s
444:       end
445:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.