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

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

				BeforeEach(func() {

					c = getDefaultConfiguration()
					d = docker.NewMock()

					d.TagHandler = func(option docker.TagOptions) error {
						return e
					}

				})
				JustBeforeEach(func() {
					err = Publish(d, ls, c)
				})
				It("should return a tag error", func() {
					Expect(err).To(HaveOccurred())
					Expect(err).To(Equal(e))
				})
				It("should try to tag the image to the repository", func() {
					Expect(d.TagCalled).To(BeTrue())
				})
				It("should not push the docker image", func() {
					Expect(d.PushCalled).To(BeFalse())