Example #1
0
	Describe("Put", func() {
		It("should put the layer", func() {
			id := "herring-id"

			Expect(driver.Put(id)).To(Succeed())

			Expect(fakeGraphDriver.PutCallCount()).To(Equal(1))
			Expect(fakeGraphDriver.PutArgsForCall(0)).To(Equal(id))
		})

		It("should retry unmounting the mnt endpoint", func() {})

		Context("when the retrier fails", func() {
			BeforeEach(func() {
				fakeRetrier.RunReturns(errors.New("banana"))
			})

			It("should return the error", func() {
				Expect(driver.Put("banana-magic")).To(MatchError("banana"))
			})

			It("should not unmount the loop device", func() {
				Expect(driver.Put("banana-magic")).To(HaveOccurred())
				Expect(fakeLoopMounter.UnmountCallCount()).To(Equal(0))
			})
		})

		It("should unmount the loop mount", func() {
			Expect(driver.Put("banana-id")).To(Succeed())