Пример #1
0
			Context("when sysprocattr is already set", func() {
				BeforeEach(func() {
					cmd.SysProcAttr = &syscall.SysProcAttr{
						Ptrace: true,
					}
				})

				It("does not clobber it", func() {
					Expect(cmd.SysProcAttr.Ptrace).To(Equal(true))
				})
			})

			Context("after wait returns", func() {
				BeforeEach(func() {
					runner.WaitReturns(42)
				})

				It("sends the exit status returned by wait to the exit status fd", func() {
					Eventually(func() byte {
						exit := make([]byte, 1)
						if n, _ := returnedFds[1].Read(exit); n > 0 {
							return exit[0]
						}

						return 255
					}).Should(Equal(byte(42)))
				})
			})

			Context("when wait does not return", func() {