Beispiel #1
0
									BeforeEach(func() {
										foundVolume.PropertiesReturns(nil, disaster)
									})

									It("returns the error", func() {
										_, err := initCache.IsInitialized()
										Expect(err).To(Equal(disaster))
									})
								})
							})

							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))