コード例 #1
0
ファイル: run_step_test.go プロジェクト: snowsnail/executor
					Expect(err).NotTo(HaveOccurred())

					_, err = io.Stderr.Write([]byte("hi err"))
					Expect(err).NotTo(HaveOccurred())

					return 34, nil
				}
			})

			It("emits the output chunks as they come in", func() {
				Expect(stdoutBuffer).To(gbytes.Say("hi out"))
				Expect(stderrBuffer).To(gbytes.Say("hi err"))
			})

			It("should flush the output when the code exits", func() {
				Expect(fakeStreamer.FlushCallCount()).To(Equal(1))
			})

			It("emits the exit status code", func() {
				Expect(stdoutBuffer).To(gbytes.Say("Exit status 34"))
			})
		})
	})

	Describe("Cancel", func() {
		var (
			performErr chan error

			waiting    chan struct{}
			waitExited chan int
		)