Class: Spec::Api::OrderGroup
- Defined in:
- lib/spec/api/mocks/order_group.rb
Instance Method Summary collapse
- #consume(expectation) ⇒ Object
-
#initialize ⇒ OrderGroup
constructor
A new instance of OrderGroup.
- #ready_for?(expectation) ⇒ Boolean
- #register(expectation) ⇒ Object
Constructor Details
#initialize ⇒ OrderGroup
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
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 |