Parent

Class Index [+]

Quicksearch

Mocha::Sequence

Used to constrain the order in which expectations can occur.

@see API#sequence @see Expectation#in_sequence

Public Class Methods

new(name) click to toggle source

@private

    # File lib/mocha/sequence.rb, line 27
27:     def initialize(name)
28:       @name = name
29:       @expectations = []
30:     end

Public Instance Methods

constrain_as_next_in_sequence(expectation) click to toggle source

@private

    # File lib/mocha/sequence.rb, line 33
33:     def constrain_as_next_in_sequence(expectation)
34:       index = @expectations.length
35:       @expectations << expectation
36:       expectation.add_ordering_constraint(InSequenceOrderingConstraint.new(self, index))
37:     end
mocha_inspect() click to toggle source

@private

    # File lib/mocha/sequence.rb, line 45
45:     def mocha_inspect
46:       "#{@name.mocha_inspect}"
47:     end
satisfied_to_index?(index) click to toggle source

@private

    # File lib/mocha/sequence.rb, line 40
40:     def satisfied_to_index?(index)
41:       @expectations[0...index].all? { |expectation| expectation.satisfied? }
42:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.