Context("when the container directory does not exist", func() { It("does not error (i.e. the method is idempotent)", func() { Expect(dirdepot.Destroy(logger, "potato")).To(Succeed()) }) }) }) Describe("handles", func() { Context("when handles exist", func() { BeforeEach(func() { Expect(dirdepot.Create(logger, "banana", fakeBundle)).To(Succeed()) Expect(dirdepot.Create(logger, "banana2", fakeBundle)).To(Succeed()) }) It("should return the handles", func() { Expect(dirdepot.Handles()).To(ConsistOf("banana", "banana2")) }) }) Context("when no handles exist", func() { It("should return an empty list", func() { Expect(dirdepot.Handles()).To(BeEmpty()) }) }) Context("when the depot directory does not exist", func() { var invalidDepot *depot.DirectoryDepot BeforeEach(func() { invalidDepot = depot.New("rubbish") })