本文整理汇总了Golang中github.com/concourse/atc/exec/fakes.FakeStepFactory.UsingCallCount方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeStepFactory.UsingCallCount方法的具体用法?Golang FakeStepFactory.UsingCallCount怎么用?Golang FakeStepFactory.UsingCallCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/concourse/atc/exec/fakes.FakeStepFactory
的用法示例。
在下文中一共展示了FakeStepFactory.UsingCallCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
StepFactory: fakeStepFactory,
}
})
JustBeforeEach(func() {
step = conditional.Using(inStep, repo)
process = ifrit.Invoke(step)
})
itDoesNothing := func() {
It("succeeds", func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
})
It("does not use the step's artifact source", func() {
Ω(fakeStepFactory.UsingCallCount()).Should(BeZero())
})
Describe("releasing", func() {
It("does not release the input source", func() {
Ω(inStep.ReleaseCallCount()).Should(Equal(0))
})
})
Describe("getting the result", func() {
It("fails", func() {
var success Success
Ω(step.Result(&success)).Should(BeFalse())
})
})
}
示例2:
repo = NewSourceRepository()
outStepA = new(fakes.FakeStep)
fakeStepA.UsingReturns(outStepA)
outStepB = new(fakes.FakeStep)
fakeStepB.UsingReturns(outStepB)
})
JustBeforeEach(func() {
step = aggregate.Using(inStep, repo)
process = ifrit.Invoke(step)
})
It("uses the input source for all steps", func() {
Ω(fakeStepA.UsingCallCount()).Should(Equal(1))
step, repo := fakeStepA.UsingArgsForCall(0)
Ω(step).Should(Equal(inStep))
Ω(repo).Should(Equal(repo))
Ω(fakeStepB.UsingCallCount()).Should(Equal(1))
step, repo = fakeStepB.UsingArgsForCall(0)
Ω(step).Should(Equal(inStep))
Ω(repo).Should(Equal(repo))
})
It("exits successfully", func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
})
Describe("executing each source", func() {
示例3:
close(startB)
close(finishB)
Eventually(process.Wait()).Should(Receive())
})
Describe("signalling", func() {
Context("when the first step is starting", func() {
It("forwards the signal to the first step and does not continue", func() {
Consistently(process.Ready()).ShouldNot(Receive())
process.Signal(os.Interrupt)
Eventually(process.Wait()).Should(Receive(Equal(ErrInterrupted)))
Ω(fakeStepFactoryB.UsingCallCount()).Should(BeZero())
})
})
Context("while the first step is running", func() {
BeforeEach(func() {
startA <- nil
})
It("forwards the signal to the first step and does not continue", func() {
Consistently(process.Ready()).ShouldNot(BeClosed())
process.Signal(os.Interrupt)
Eventually(process.Wait()).Should(Receive(Equal(ErrInterrupted)))
示例4:
outStep.ResultStub = successResult(false)
startStep <- nil
finishStep <- nil
startSuccess <- nil
finishSuccess <- nil
startNextStep <- nil
finishNextStep <- nil
})
It("does not proceed to the next step", func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
Ω(fakeStepFactorySuccessStep.UsingCallCount()).Should(BeZero())
Ω(fakeStepFactoryNextStep.UsingCallCount()).Should(BeZero())
})
Describe("releasing", func() {
It("releases the first source", func() {
Eventually(process.Wait()).Should(Receive())
err := step.Release()
Ω(err).ShouldNot(HaveOccurred())
Ω(outStep.ReleaseCallCount()).Should(Equal(3))
Ω(successStep.ReleaseCallCount()).Should(BeZero())
Ω(nextStep.ReleaseCallCount()).Should(BeZero())
})
示例5:
repo = NewSourceRepository()
outStepA = new(fakes.FakeStep)
fakeStepA.UsingReturns(outStepA)
outStepB = new(fakes.FakeStep)
fakeStepB.UsingReturns(outStepB)
})
JustBeforeEach(func() {
step = aggregate.Using(inStep, repo)
process = ifrit.Invoke(step)
})
It("uses the input source for all steps", func() {
Expect(fakeStepA.UsingCallCount()).To(Equal(1))
step, repo := fakeStepA.UsingArgsForCall(0)
Expect(step).To(Equal(inStep))
Expect(repo).To(Equal(repo))
Expect(fakeStepB.UsingCallCount()).To(Equal(1))
step, repo = fakeStepB.UsingArgsForCall(0)
Expect(step).To(Equal(inStep))
Expect(repo).To(Equal(repo))
})
It("exits successfully", func() {
Eventually(process.Wait()).Should(Receive(BeNil()))
})
Describe("executing each source", func() {