Example #1
0
			})

			It("should not remove the backing store file", func() {
				Expect(driver.Put("banana-id")).To(HaveOccurred())
				Expect(fakeBackingStoreMgr.DeleteCallCount()).To(Equal(0))
			})
		})

		It("should remove the backing store file", func() {
			id := "banana-id"

			driver.GetQuotaed(id, "", 10*1024)

			Expect(driver.Put("banana-id")).To(Succeed())

			Expect(fakeRetrier.RunCallCount()).To(Equal(1))

			Expect(fakeBackingStoreMgr.DeleteCallCount()).To(Equal(1))
			Expect(fakeBackingStoreMgr.DeleteArgsForCall(0)).To(Equal(id))
		})

		Context("when removig the backing store file fails", func() {
			BeforeEach(func() {
				fakeBackingStoreMgr.DeleteReturns(errors.New("banana"))
			})

			It("should return an error", func() {
				Expect(driver.Put("banana-shed")).To(MatchError("removing the backing store: banana"))
			})
		})
	})