Пример #1
0
				if id == parentID {
					return parentDir, nil
				}

				if id == namespacedChildID {
					return namespacedChildDir, nil
				}

				if id == otherNamespacedChildID {
					return otherNamespacedChildDir, nil
				}

				return "", nil
			}

			cake.IsLeafReturns(true, nil)
		})

		AfterEach(func() {
			Expect(os.RemoveAll(parentDir)).To(Succeed())
			Expect(os.RemoveAll(namespacedChildDir)).To(Succeed())
			Expect(os.RemoveAll(otherNamespacedChildDir)).To(Succeed())
		})

		Context("when the image ID is not namespaced", func() {
			It("should delegate to the cake", func() {
				cake.CreateReturns(testError)
				Expect(aufsCake.Create(childID, parentID, "potato")).To(Equal(testError))
				Expect(cake.CreateCallCount()).To(Equal(1))
				cid, iid, containerID := cake.CreateArgsForCall(0)
				Expect(cid).To(Equal(childID))