Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 221594b6ab
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (28 sloc) 0.629 kb
module RSpec
module Mocks
# @private
class OrderGroup
def initialize
@ordering = Array.new
end
# @private
def register(expectation)
@ordering << expectation
end
# @private
def ready_for?(expectation)
@ordering.first == expectation
end
# @private
def consume
@ordering.shift
end
# @private
def handle_order_constraint expectation
return unless @ordering.include? expectation
return consume if ready_for?(expectation)
expectation.raise_out_of_order_error
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.