Class: Spec::Api::OrderGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/api/mocks/order_group.rb

Instance Method Summary collapse

Constructor Details

#initializeOrderGroup

Returns a new instance of OrderGroup.



4
5
6
# File 'lib/spec/api/mocks/order_group.rb', line 4

def initialize
  @ordering = Array.new
end

Instance Method Details

#consume(expectation) ⇒ Object



16
17
18
# File 'lib/spec/api/mocks/order_group.rb', line 16

def consume(expectation)
  @ordering.shift
end

#ready_for?(expectation) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/spec/api/mocks/order_group.rb', line 12

def ready_for?(expectation)
  return @ordering.first == expectation
end

#register(expectation) ⇒ Object



8
9
10
# File 'lib/spec/api/mocks/order_group.rb', line 8

def register(expectation)
  @ordering << expectation
end