當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。