origIO := garden.ProcessIO{ Stdout: gbytes.NewBuffer(), } _, err := container.Run(origSpec, origIO) Expect(err).ToNot(HaveOccurred()) Expect(containerizer.RunCallCount()).To(Equal(1)) _, id, spec, io := containerizer.RunArgsForCall(0) Expect(id).To(Equal("banana")) Expect(spec).To(Equal(origSpec)) Expect(io).To(Equal(origIO)) }) Context("when the containerizer fails to run a process", func() { BeforeEach(func() { 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)