class Mocha::Sequence
Used to constrain the order in which expectations can occur.
@see API#sequence
@see Expectation#in_sequence
Public Class Methods
Source
# File lib/mocha/sequence.rb, line 24 def initialize(name) @name = name @expectations = [] end
@private
Public Instance Methods
Source
# File lib/mocha/sequence.rb, line 30 def constrain_as_next_in_sequence(expectation) index = @expectations.length @expectations << expectation expectation.add_ordering_constraint(InSequenceOrderingConstraint.new(self, index)) end
@private
Source
# File lib/mocha/sequence.rb, line 42 def mocha_inspect @name.mocha_inspect.to_s end
@private
Source
# File lib/mocha/sequence.rb, line 37 def satisfied_to_index?(index) @expectations[0...index].all?(&:satisfied?) end
@private