Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e62d381057
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (34 sloc) 0.735 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
def clear
@ordering.clear
end
def empty?
@ordering.empty?
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.