parent = layercake.ContainerID("") }) ItCanReadWriteTheLayer := func() { It("can read and write files", func() { p, err := cake.Path(id) Expect(err).NotTo(HaveOccurred()) Expect(ioutil.WriteFile(path.Join(p, "foo"), []byte("hi"), 0700)).To(Succeed()) p, err = cake.Path(id) Expect(err).NotTo(HaveOccurred()) Expect(path.Join(p, "foo")).To(BeAnExistingFile()) }) It("can get back the image", func() { img, err := cake.Get(id) Expect(err).NotTo(HaveOccurred()) Expect(img.ID).To(Equal(id.GraphID())) Expect(img.Parent).To(Equal(parent.GraphID())) }) } Context("when the new layer is a docker image", func() { JustBeforeEach(func() { id = layercake.DockerImageID("70d8f0edf5c9008eb61c7c52c458e7e0a831649dbb238b93dde0854faae314a8") registerImageLayer(cake, &image.Image{ ID: id.GraphID(), Parent: parent.GraphID(), }) })