Describe("Initialize", func() { It("sets the initialized property on the volume", func() { Expect(initCache.Initialize()).To(Succeed()) Expect(foundVolume.SetPropertyCallCount()).To(Equal(1)) name, value := foundVolume.SetPropertyArgsForCall(0) Expect(name).To(Equal("initialized")) Expect(value).To(Equal("yep")) }) Context("when setting the property fails", func() { disaster := errors.New("nope") BeforeEach(func() { foundVolume.SetPropertyReturns(disaster) }) It("returns the error", func() { err := initCache.Initialize() Expect(err).To(Equal(disaster)) }) }) }) }) }) Context("when an initialized volume for the cache is not present", func() { var createdVolume *bfakes.FakeVolume BeforeEach(func() {