return nil } err := container.StreamIn("/dst/path", data) Ω(err).ShouldNot(HaveOccurred()) Ω(fakeContainer.StreamInCallCount()).Should(Equal(1)) }) itFailsWhenTheContainerIsNotFound(func() error { return container.StreamIn("/dst/path", nil) }) Context("when copying in to the container fails", func() { BeforeEach(func() { fakeContainer.StreamInReturns(errors.New("oh no!")) }) It("fails", func() { err := container.StreamIn("/dst/path", nil) Ω(err).Should(HaveOccurred()) }) }) }) Describe("streaming out", func() { var streamOut io.ReadCloser BeforeEach(func() { streamOut = ioutil.NopCloser(bytes.NewBuffer([]byte("hello-world!"))) })