Esempio n. 1
0
					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))
						})
					})

					It("looked up the container via the session ID", func() {
						Ω(fakeWorkerClient.LookupContainerArgsForCall(0)).Should(Equal(identifier))
					})

					It("gets the config from the input artifact soruce", func() {
						Ω(configSource.FetchConfigCallCount()).Should(Equal(1))
						Ω(configSource.FetchConfigArgsForCall(0)).Should(Equal(repo))
					})

					It("creates a container with the config's image and the session ID as the handle", func() {
						Ω(fakeWorkerClient.CreateContainerCallCount()).Should(Equal(1))
						createdIdentifier, spec := fakeWorkerClient.CreateContainerArgsForCall(0)
						Ω(createdIdentifier).Should(Equal(identifier))

						taskSpec := spec.(worker.TaskContainerSpec)
						Ω(taskSpec.Platform).Should(Equal("some-platform"))
						Ω(taskSpec.Tags).Should(ConsistOf("config", "step", "tags"))