本文整理汇总了Golang中github.com/concourse/atc/worker/fakes.FakeWorker.SatisfyingReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeWorker.SatisfyingReturns方法的具体用法?Golang FakeWorker.SatisfyingReturns怎么用?Golang FakeWorker.SatisfyingReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/concourse/atc/worker/fakes.FakeWorker
的用法示例。
在下文中一共展示了FakeWorker.SatisfyingReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
satisfyingWorker, satisfyingErr = pool.Satisfying(spec, resourceTypes)
})
Context("with multiple workers", func() {
var (
workerA *fakes.FakeWorker
workerB *fakes.FakeWorker
workerC *fakes.FakeWorker
)
BeforeEach(func() {
workerA = new(fakes.FakeWorker)
workerB = new(fakes.FakeWorker)
workerC = new(fakes.FakeWorker)
workerA.SatisfyingReturns(workerA, nil)
workerB.SatisfyingReturns(workerB, nil)
workerC.SatisfyingReturns(nil, errors.New("nope"))
fakeProvider.WorkersReturns([]Worker{workerA, workerB, workerC}, nil)
})
It("succeeds", func() {
Expect(satisfyingErr).NotTo(HaveOccurred())
})
It("checks that the workers satisfy the given spec", func() {
Expect(workerA.SatisfyingCallCount()).To(Equal(1))
actualSpec, actualResourceTypes := workerA.SatisfyingArgsForCall(0)
Expect(actualSpec).To(Equal(spec))
Expect(actualResourceTypes).To(Equal(resourceTypes))