fakeAuctioneerClient.RequestTaskAuctionsReturns(errors.New("oops")) }) It("does not return an error", func() { Expect(err).NotTo(HaveOccurred()) }) It("does not request a second auction", func() { Consistently(fakeAuctioneerClient.RequestTaskAuctionsCallCount).Should(Equal(1)) }) }) }) Context("when desiring the task fails", func() { BeforeEach(func() { fakeTaskDB.DesireTaskReturns(errors.New("kaboom")) }) It("responds with an error", func() { Expect(err).To(MatchError("kaboom")) }) }) }) Describe("StartTask", func() { Context("when the start is successful", func() { var ( taskGuid, cellId string shouldStart bool err error )