})) }) Context("when an artifact is not specified", func() { It("does not stream the download information", func() { err := step.Perform() Expect(err).NotTo(HaveOccurred()) stdout := fakeStreamer.Stdout().(*gbytes.Buffer) Expect(stdout.Contents()).To(BeEmpty()) }) }) Context("when an artifact is specified", func() { BeforeEach(func() { downloadAction.Artifact = "artifact" }) Describe("logging the size", func() { Context("when nothing had to be downloaded", func() { BeforeEach(func() { cache.FetchReturns(gbytes.NewBuffer(), 0, nil) // 0 bytes downlaoded }) It("streams unknown when the Fetch does not return a File", func() { Expect(stepErr).NotTo(HaveOccurred()) stdout := fakeStreamer.Stdout().(*gbytes.Buffer) Expect(stdout.Contents()).To(ContainSubstring("Downloaded artifact\n")) }) })