本文整理汇总了Golang中github.com/concourse/atc/resource/fakes.FakeResource.ReleaseCallCount方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeResource.ReleaseCallCount方法的具体用法?Golang FakeResource.ReleaseCallCount怎么用?Golang FakeResource.ReleaseCallCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/concourse/atc/resource/fakes.FakeResource
的用法示例。
在下文中一共展示了FakeResource.ReleaseCallCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例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()
Expect(fakeResource.ReleaseCallCount()).To(Equal(1))
Expect(fakeResource.ReleaseArgsForCall(0)).To(Equal(worker.FinalTTL(5 * time.Minute)))
})
})
Describe("signalling", func() {
var receivedSignals <-chan os.Signal
BeforeEach(func() {
sigs := make(chan os.Signal)
receivedSignals = sigs
fakeVersionedSource.RunStub = func(signals <-chan os.Signal, ready chan<- struct{}) error {
示例2:
It("is not successful", func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
Ω(getDelegate.CompletedCallCount()).Should(Equal(1))
var success Success
Ω(step.Result(&success)).Should(BeTrue())
Ω(bool(success)).Should(BeFalse())
})
})
})
Describe("releasing", func() {
It("releases the resource", func() {
Ω(fakeResource.ReleaseCallCount()).Should(BeZero())
err := step.Release()
Ω(err).ShouldNot(HaveOccurred())
Ω(fakeResource.ReleaseCallCount()).Should(Equal(1))
})
})
Describe("the source registered with the repository", func() {
var artifactSource ArtifactSource
JustBeforeEach(func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
var found bool