示例#1
0
				Context("when creating the task's container works", func() {
					var (
						fakeContainer *wfakes.FakeContainer
						fakeProcess   *gfakes.FakeProcess
					)

					BeforeEach(func() {
						fakeContainer = new(wfakes.FakeContainer)
						fakeContainer.HandleReturns("some-handle")
						fakeWorkerClient.CreateContainerReturns(fakeContainer, nil)

						fakeProcess = new(gfakes.FakeProcess)
						fakeProcess.IDReturns(42)
						fakeContainer.RunReturns(fakeProcess, nil)

						fakeContainer.StreamInReturns(nil)
					})

					Describe("before having created the container", func() {
						BeforeEach(func() {
							taskDelegate.InitializingStub = func(atc.TaskConfig) {
								defer GinkgoRecover()
								Ω(fakeWorkerClient.CreateContainerCallCount()).Should(BeZero())
							}
						})

						It("invokes the delegate's Initializing callback", func() {
							Ω(taskDelegate.InitializingCallCount()).Should(Equal(1))
							Ω(taskDelegate.InitializingArgsForCall(0)).Should(Equal(fetchedConfig))
						})
					})