Esempio n. 1
0
				})
				AssertNoDockerClientUsage()
			})
		})
		Context("when the docker client have issue(s)", func() {
			Context("because it cannot build an image", func() {

				var (
					e = errors.New("error: invalid image name")
				)

				BeforeEach(func() {
					c = getDefaultConfiguration()
					d = docker.NewMock()
					d.BuildHandler = func(option docker.BuildOptions, stream docker.LogStream) error {
						return e
					}
					d.ImageIDHandler = getImageIDHandler("2dc8f5484fd8", "2dc8f5484fd8")
				})
				It("should return a build error", func() {
					Expect(err).To(HaveOccurred())
					Expect(err).To(Equal(e))
				})
				It("should try to build an image", ExpectDockerBuildImage)
				It("should not remove any previous image", func() {
					Expect(d.RemoveImageCalled).To(BeFalse())
				})
			})
			Context("because it cannot build an image, but a new image exists somehow", func() {

				var (