コード例 #1
0
			Stdout: gbytes.NewBuffer(),
		}

		BeforeEach(func() {
			fakeProcess = new(gfakes.FakeProcess)
			fakeProcess.IDReturns(6)
		})

		itRetries(func() error {
			var err error
			process, err = conn.Run("la-contineur", processSpec, processIO)
			return err
		}, func(err error) {
			innerConnection.RunReturns(fakeProcess, err)
		}, func() int {
			return innerConnection.RunCallCount()
		}, func() {
			It("calls through to garden", func() {
				Ω(innerConnection.RunCallCount()).Should(Equal(1))

				handle, calledProcessSpec, calledProcessIO := innerConnection.RunArgsForCall(0)
				Ω(handle).Should(Equal("la-contineur"))
				Ω(calledProcessSpec).Should(Equal(processSpec))
				Ω(calledProcessIO).Should(Equal(processIO))
			})

			Describe("the process", func() {
				BeforeEach(func() {
					innerConnection.AttachReturns(fakeProcess, nil)
				})
コード例 #2
0
			Stdout: gbytes.NewBuffer(),
		}

		BeforeEach(func() {
			fakeProcess = new(gfakes.FakeProcess)
			fakeProcess.IDReturns("process-id")
		})

		itRetries(func() error {
			var err error
			process, err = conn.Run("la-contineur", processSpec, processIO)
			return err
		}, func(err error) {
			innerConnection.RunReturns(fakeProcess, err)
		}, func() int {
			return innerConnection.RunCallCount()
		}, func() {
			It("calls through to garden", func() {
				Expect(innerConnection.RunCallCount()).To(Equal(1))

				handle, calledProcessSpec, calledProcessIO := innerConnection.RunArgsForCall(0)
				Expect(handle).To(Equal("la-contineur"))
				Expect(calledProcessSpec).To(Equal(processSpec))
				Expect(calledProcessIO).To(Equal(processIO))
			})

			Describe("the process", func() {
				BeforeEach(func() {
					innerConnection.AttachReturns(fakeProcess, nil)
				})