Sha256: a621401f4391b9537d671e45ea240d4a9de3bd326eaf902badf02f57f3c573ed
Contents?: true
Size: 663 Bytes
Versions: 158
Compression:
Stored size: 663 Bytes
Contents
module Spec module Mocks class OrderGroup def initialize error_generator @error_generator = error_generator @ordering = Array.new end def register(expectation) @ordering << expectation end def ready_for?(expectation) return @ordering.first == expectation end def consume @ordering.shift end def handle_order_constraint expectation return unless @ordering.include? expectation return consume if ready_for?(expectation) @error_generator.raise_out_of_order_error expectation.sym end end end end
Version data entries
158 entries across 158 versions & 25 rubygems