Expect(client.PerformCallCount()).To(Equal(0)) }) }) Context("with work to commit", func() { var lrp rep.LRP BeforeEach(func() { lrp = *BuildLRP("pg-new", "domain", 0, linuxRootFSURL, 20, 10) Expect(cell.ReserveLRP(&lrp)).To(Succeed()) }) It("asks the client to perform", func() { cell.Commit() Expect(client.PerformCallCount()).To(Equal(1)) Expect(client.PerformArgsForCall(0)).To(Equal(rep.Work{ LRPs: []rep.LRP{lrp}, })) }) Context("when the client returns some failed work", func() { It("forwards the failed work", func() { failedWork := rep.Work{ LRPs: []rep.LRP{lrp}, } client.PerformReturns(failedWork, nil) Expect(cell.Commit()).To(Equal(failedWork)) }) })