containerizer.RunReturns(nil, errors.New("lost my banana")) }) It("returns the error", func() { _, err := container.Run(garden.ProcessSpec{}, garden.ProcessIO{}) Expect(err).To(MatchError("lost my banana")) }) }) }) Describe("streaming files in to the container", func() { It("asks the containerizer to stream in the tar stream", func() { spec := garden.StreamInSpec{Path: "potato", User: "******", TarStream: gbytes.NewBuffer()} Expect(container.StreamIn(spec)).To(Succeed()) _, handle, specArg := containerizer.StreamInArgsForCall(0) Expect(handle).To(Equal("banana")) Expect(specArg).To(Equal(spec)) }) }) Describe("streaming files outside the container", func() { It("asks the containerizer to stream out the files", func() { spec := garden.StreamOutSpec{Path: "potato", User: "******"} _, err := container.StreamOut(spec) Expect(err).To(Succeed()) _, handle, specArg := containerizer.StreamOutArgsForCall(0) Expect(handle).To(Equal("banana")) Expect(specArg).To(Equal(spec)) })