class Mocha::Sequence
@see Expectation#in_sequence
@see API#sequence
Used to constrain the order in which expectations can occur.
def constrain_as_next_in_sequence(expectation)
- Private: -
def constrain_as_next_in_sequence(expectation) index = @expectations.length @expectations << expectation expectation.add_ordering_constraint(InSequenceOrderingConstraint.new(self, index)) end
def initialize(name)
- Private: -
def initialize(name) @name = name @expectations = [] end
def mocha_inspect
- Private: -
def mocha_inspect @name.mocha_inspect.to_s end
def satisfied_to_index?(index)
- Private: -
def satisfied_to_index?(index) @expectations[0...index].all?(&:satisfied?) end