예제 #1
0
파일: tracker_test.go 프로젝트: ACPK/atc
					It("does not error and returns a resource", func() {
						Expect(initErr).NotTo(HaveOccurred())
						Expect(initResource).NotTo(BeNil())
					})

					It("chose the worker satisfying the resource type and tags", func() {
						Expect(workerClient.AllSatisfyingCallCount()).To(Equal(1))
						Expect(workerClient.AllSatisfyingArgsForCall(0)).To(Equal(worker.WorkerSpec{
							ResourceType: "type1",
							Tags:         []string{"resource", "tags"},
						}))
					})

					It("looked for the sources on the correct worker", func() {
						Expect(inputSource1.VolumeOnCallCount()).To(Equal(1))
						actualWorker := inputSource1.VolumeOnArgsForCall(0)
						Expect(actualWorker).To(Equal(satisfyingWorker))

						Expect(inputSource2.VolumeOnCallCount()).To(Equal(1))
						actualWorker = inputSource2.VolumeOnArgsForCall(0)
						Expect(actualWorker).To(Equal(satisfyingWorker))

						Expect(inputSource3.VolumeOnCallCount()).To(Equal(1))
						actualWorker = inputSource3.VolumeOnArgsForCall(0)
						Expect(actualWorker).To(Equal(satisfyingWorker))
					})

					It("creates the container with the cache volume", func() {
						Expect(satisfyingWorker.CreateContainerCallCount()).To(Equal(1))
						_, id, spec := satisfyingWorker.CreateContainerArgsForCall(0)