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


Golang FakeStepFactory.UsingArgsForCall方法代码示例

本文整理汇总了Golang中github.com/concourse/atc/exec/fakes.FakeStepFactory.UsingArgsForCall方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeStepFactory.UsingArgsForCall方法的具体用法?Golang FakeStepFactory.UsingArgsForCall怎么用?Golang FakeStepFactory.UsingArgsForCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/concourse/atc/exec/fakes.FakeStepFactory的用法示例。


在下文中一共展示了FakeStepFactory.UsingArgsForCall方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

		process := ifrit.Background(ensureStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(hook.RunCallCount).Should(Equal(1))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("provides the step as the previous step to the hook", func() {
		process := ifrit.Background(ensureStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(hookFactory.UsingCallCount).Should(Equal(1))

		argsPrev, argsRepo := hookFactory.UsingArgsForCall(0)
		Expect(argsPrev).To(Equal(step))
		Expect(argsRepo).To(Equal(repo))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("runs the ensured hook even if the step errors", func() {
		step.RunReturns(errors.New("disaster"))

		process := ifrit.Background(ensureStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(process.Wait()).Should(Receive(errorMatching(ContainSubstring("disaster"))))

		Expect(hook.RunCallCount()).To(Equal(1))
开发者ID:ACPK,项目名称:atc,代码行数:30,代码来源:ensure_test.go

示例2:

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(hook.RunCallCount).Should(Equal(1))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("provides the step as the previous step to the hook", func() {
		step.ResultStub = successResult(true)

		process := ifrit.Background(onSuccessStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(successFactory.UsingCallCount).Should(Equal(1))

		argsPrev, argsRepo := successFactory.UsingArgsForCall(0)
		Ω(argsPrev).Should(Equal(step))
		Ω(argsRepo).Should(Equal(repo))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("does not run the success hook if the step errors", func() {
		step.RunReturns(errors.New("disaster"))

		process := ifrit.Background(onSuccessStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(process.Wait()).Should(Receive(errorMatching("disaster")))
		Ω(hook.RunCallCount()).Should(Equal(0))
	})
开发者ID:utako,项目名称:atc,代码行数:30,代码来源:on_success_test.go

示例3:

			It("fails", func() {
				var success Success
				Ω(step.Result(&success)).Should(BeFalse())
			})
		})
	}

	itDoesAThing := func() {
		It("succeeds", func() {
			Eventually(process.Wait()).Should(Receive(BeNil()))
		})

		It("uses the step's artifact source", func() {
			Ω(fakeStepFactory.UsingCallCount()).Should(Equal(1))

			step, repo := fakeStepFactory.UsingArgsForCall(0)
			Ω(step).Should(Equal(inStep))
			Ω(repo).Should(Equal(repo))
		})

		Describe("releasing", func() {
			It("releases the output source", func() {
				err := step.Release()
				Ω(err).ShouldNot(HaveOccurred())

				Ω(outStep.ReleaseCallCount()).Should(Equal(1))
			})

			Context("when releasing the output source fails", func() {
				disaster := errors.New("nope")
开发者ID:savaki,项目名称:atc,代码行数:30,代码来源:conditional_test.go

示例4:

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(hook.RunCallCount).Should(Equal(1))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("provides the step as the previous step to the hook", func() {
		step.ResultStub = successResult(false)

		process := ifrit.Background(onFailureStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(failureFactory.UsingCallCount).Should(Equal(1))

		argsPrev, argsRepo := failureFactory.UsingArgsForCall(0)
		Expect(argsPrev).To(Equal(step))
		Expect(argsRepo).To(Equal(repo))

		Eventually(process.Wait()).Should(Receive(noError()))
	})

	It("does not run the failure hook if the step errors", func() {
		step.RunReturns(errors.New("disaster"))

		process := ifrit.Background(onFailureStep)

		Eventually(step.RunCallCount).Should(Equal(1))
		Eventually(process.Wait()).Should(Receive(errorMatching("disaster")))
		Expect(hook.RunCallCount()).To(Equal(0))
	})
开发者ID:ACPK,项目名称:atc,代码行数:30,代码来源:on_failure_test.go

示例5:

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

示例6:

				AfterEach(func() {
					close(startEnsure)
					close(finishEnsure)
				})

				Context("and the first step finishes successfully", func() {
					BeforeEach(func() {
						startStep <- nil
						finishStep <- nil
					})

					It("executes the success step", func() {
						Eventually(fakeStepFactorySuccessStep.UsingCallCount).Should(Equal(1))
						Eventually(successStep.RunCallCount).Should(Equal(1))
						step, repo = fakeStepFactorySuccessStep.UsingArgsForCall(0)
						Ω(step).Should(Equal(outStep))
						Ω(repo).Should(Equal(repo))

						Eventually(ensureStep.RunCallCount).Should(Equal(0))
					})

					Context("and the success step finishes successfully", func() {
						BeforeEach(func() {
							startSuccess <- nil
							finishSuccess <- nil
						})

						It("executes the ensure step", func() {
							Eventually(fakeStepFactoryEnsureStep.UsingCallCount).Should(Equal(1))
							Eventually(ensureStep.RunCallCount).Should(Equal(1))
开发者ID:savaki,项目名称:atc,代码行数:30,代码来源:hooked_compose_step_test.go


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