コード例 #1
0
						cache.FetchReturns(gbytes.NewBuffer(), 42, nil)
					})

					It("streams the size when the Fetch returns a File", func() {
						Expect(stepErr).NotTo(HaveOccurred())

						stdout := fakeStreamer.Stdout().(*gbytes.Buffer)
						Expect(stdout.Contents()).To(ContainSubstring("Downloaded artifact (42B)"))
					})
				})
			})
		})

		Context("when there is an error parsing the download url", func() {
			BeforeEach(func() {
				downloadAction.From = "foo/bar"
			})

			It("returns an error", func() {
				Expect(stepErr).To(HaveOccurred())
			})

			It("logs the step", func() {
				Expect(logger.TestSink.LogMessages()).To(ConsistOf([]string{
					"test.download-step.fetch-starting",
					"test.download-step.parse-request-uri-error",
				}))

			})
		})