Exemple #1
0
				exitStatus, verionInfo := putDelegate.CompletedArgsForCall(0)
				Expect(exitStatus).To(Equal(ExitStatus(0)))
				Expect(verionInfo).To(Equal(&VersionInfo{
					Version:  atc.Version{"some": "version"},
					Metadata: []atc.MetadataField{{"some", "metadata"}},
				}))
			})

			Context("before initializing the resource", func() {
				var callCountDuringInit chan int

				BeforeEach(func() {
					callCountDuringInit = make(chan int, 1)

					fakeTracker.InitWithSourcesStub = func(lager.Logger, resource.Metadata, resource.Session, resource.ResourceType, atc.Tags, map[string]resource.ArtifactSource, atc.ResourceTypes, worker.ImageFetchingDelegate) (resource.Resource, []string, error) {
						callCountDuringInit <- putDelegate.InitializingCallCount()
						return fakeResource, []string{"some-source", "some-other-source"}, nil
					}
				})

				It("calls the Initializing method on the delegate", func() {
					Expect(<-callCountDuringInit).To(Equal(1))
				})
			})

			Describe("releasing", func() {
				It("releases the resource with a ttl of 5 minutes", func() {
					<-process.Wait()

					Expect(fakeResource.ReleaseCallCount()).To(BeZero())

					step.Release()