Example #1
0
					step.Cancel()

					Eventually(errs).Should(Receive(Equal(steps.ErrCancelled)))
				})
			})

			Describe("streaming logs for uploads", func() {
				BeforeEach(func() {
					fakeUploader := new(fake_uploader.FakeUploader)
					fakeUploader.UploadReturns(1024, nil)
					uploader = fakeUploader
				})

				Context("when an artifact is specified", func() {
					BeforeEach(func() {
						uploadAction.Artifact = "artifact"
					})

					It("streams the upload filesize", func() {
						err := step.Perform()
						Expect(err).NotTo(HaveOccurred())

						stdout := fakeStreamer.Stdout().(*gbytes.Buffer)
						Expect(stdout.Contents()).To(ContainSubstring("Uploaded artifact (1K)"))
					})
				})

				Context("when an artifact is not specified", func() {
					It("does not stream the upload information", func() {
						err := step.Perform()
						Expect(err).NotTo(HaveOccurred())