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.

Methods
Public Class methods
new()

Initialize the composite expectation.

     # File lib/flexmock/expectation.rb, line 402
402:     def initialize
403:       @expectations = []
404:     end
Public Instance methods
add(expectation)

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)

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()

Return the associated mock object.

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

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)

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()

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