alphagov/govuk_crawler_worker — pull request #17 by dcarley (2014-07-04 15:23:41+00:00)
Title: Move test assertions out of range(chan)

This pattern of calling range on a channel and asserting that one item
matches our test assertions will fail to raise an error if the queue is
empty.

So instead change these to read a single item from the channel, which will
block if the channel is empty, and then make the assertion. I've added a
done channel so that Ginkgo fails the test if we block for longer than the
default of 1s:

http://onsi.github.io/ginkgo/#asynchronous-tests