It("does not error and returns a resource", func() { Expect(initErr).NotTo(HaveOccurred()) Expect(initResource).NotTo(BeNil()) }) It("does not create a container", func() { Expect(workerClient.SatisfyingCallCount()).To(BeZero()) Expect(workerClient.CreateContainerCallCount()).To(BeZero()) }) Context("when the container has a cache volume", func() { var cacheVolume *bfakes.FakeVolume BeforeEach(func() { cacheVolume = new(bfakes.FakeVolume) fakeContainer.VolumesReturns([]worker.Volume{cacheVolume}) }) Describe("the cache", func() { Describe("IsInitialized", func() { Context("when the volume has the initialized property set", func() { BeforeEach(func() { cacheVolume.PropertiesReturns(baggageclaim.VolumeProperties{ "initialized": "any-value", }, nil) }) It("returns true", func() { Expect(initCache.IsInitialized()).To(BeTrue()) }) })