Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

WIP - repeated calls for next integration request

  • Loading branch information...
commit f9b392aaaabb0ece48407b473f4924ef906eb6b5 1 parent 2060d6a
@rorymckinley authored
View
7 spec/keizoku/integration_dispatcher_spec.rb
@@ -50,4 +50,11 @@ def run
dispatcher.run
end
+
+ it "makes repeated calls to the scheduler until there are no remaining integration requests" do
+ scheduler = double(Keizoku::IntegrationScheduler).as_null_object
+ scheduler.should_receive(:next_integration_request).and_return(request, nil)
+
+ dispatcher.run
+ end
end
View
11 spec/keizoku/integration_scheduler_spec.rb
@@ -87,4 +87,15 @@ def enqueue(quantity = 1, request = integration_request, clock = ->() { DateTime
end
+ context "when the queue empties" do
+ it "#next_integration_request returns nil if the queue is empty" do
+ enqueue
+ scheduler.read_queue
+ request = scheduler.next_integration_request
+ scheduler.complete_integration_request(request)
+
+ scheduler.next_integration_request.should be_nil
+ end
+ end
+
end

0 comments on commit f9b392a

Please sign in to comment.
Something went wrong with that request. Please try again.