当前位置: 首页>>代码示例>>Golang>>正文


Golang FakeStepFactory.UsingCallCount方法代码示例

本文整理汇总了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())
			})
		})
	}
开发者ID:savaki,项目名称:atc,代码行数:31,代码来源:conditional_test.go

示例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() {
开发者ID:savaki,项目名称:atc,代码行数:31,代码来源:aggregate_test.go

示例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)))
开发者ID:utako,项目名称:atc,代码行数:30,代码来源:compose_test.go

示例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())
					})
开发者ID:savaki,项目名称:atc,代码行数:30,代码来源:hooked_compose_step_test.go

示例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() {
开发者ID:pcfdev-forks,项目名称:atc,代码行数:31,代码来源:aggregate_test.go


注:本文中的github.com/concourse/atc/exec/fakes.FakeStepFactory.UsingCallCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。