本文整理汇总了Golang中github.com/concourse/atc/engine/fakes.FakeEngine.LookupBuildCallCount方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeEngine.LookupBuildCallCount方法的具体用法?Golang FakeEngine.LookupBuildCallCount怎么用?Golang FakeEngine.LookupBuildCallCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/concourse/atc/engine/fakes.FakeEngine
的用法示例。
在下文中一共展示了FakeEngine.LookupBuildCallCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
BeforeEach(func() {
fakeBuildDB.AbortBuildReturns(nil)
})
It("succeeds", func() {
Ω(abortErr).ShouldNot(HaveOccurred())
})
It("aborts the build in the db", func() {
Ω(fakeBuildDB.AbortBuildCallCount()).Should(Equal(1))
Ω(fakeBuildDB.AbortBuildArgsForCall(0)).Should(Equal(model.ID))
})
It("does not abort the real build", func() {
Ω(fakeBuildDB.GetBuildCallCount()).Should(BeZero())
Ω(fakeEngineB.LookupBuildCallCount()).Should(BeZero())
})
})
Context("when aborting the build in the db fails", func() {
disaster := errors.New("oh no!")
BeforeEach(func() {
fakeBuildDB.AbortBuildReturns(disaster)
})
It("fails", func() {
Ω(abortErr).Should(Equal(disaster))
})
})
})
示例2:
BeforeEach(func() {
fakeBuildDB.AbortBuildReturns(nil)
})
It("succeeds", func() {
Expect(abortErr).NotTo(HaveOccurred())
})
It("aborts the build in the db", func() {
Expect(fakeBuildDB.AbortBuildCallCount()).To(Equal(1))
Expect(fakeBuildDB.AbortBuildArgsForCall(0)).To(Equal(model.ID))
})
It("does not abort the real build", func() {
Expect(fakeBuildDB.GetBuildCallCount()).To(BeZero())
Expect(fakeEngineB.LookupBuildCallCount()).To(BeZero())
})
})
Context("when aborting the build in the db fails", func() {
disaster := errors.New("oh no!")
BeforeEach(func() {
fakeBuildDB.AbortBuildReturns(disaster)
})
It("fails", func() {
Expect(abortErr).To(Equal(disaster))
})
})
})