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


Golang Call.After方法代码示例

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


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

示例1:

				Port:     123,
			}

			spy = test_support_mocks.NewMockSpy(mockCtrl)
			startCall = mockRegistryServerManager.EXPECT().Start("fake-username", "fake-password", "fake-host", 123).Return(mockRegistryServer, nil)
			spyCall = spy.EXPECT().Record()
			stopCall = mockRegistryServer.EXPECT().Stop().Return(nil)

			logBuffer = gbytes.NewBuffer()
			goLogger := log.New(logBuffer, "", log.LstdFlags)
			logger = boshlog.New(boshlog.LevelWarn, goLogger, goLogger)
			fakeStage = fakebiui.NewFakeStage()
		})

		It("starts the registry before calling the function", func() {
			spyCall.After(startCall)

			err := newInstalation().WithRunningRegistry(logger, fakeStage, func() error {
				spy.Record()
				return nil
			})
			Expect(err).NotTo(HaveOccurred())
		})

		It("performs stages for starting and stopping the registry", func() {
			err := newInstalation().WithRunningRegistry(logger, fakeStage, func() error {
				spy.Record()
				return nil
			})
			Expect(err).NotTo(HaveOccurred())
开发者ID:vestel,项目名称:bosh-init,代码行数:30,代码来源:installation_test.go

示例2:

				Name:          "fake-release-package-name-3",
				Fingerprint:   "fake-release-package-fingerprint-3",
				SHA1:          "fake-release-package-sha1-3",
				Dependencies:  []*birelpkg.Package{releasePackage1},
				ExtractedPath: "/extracted-release-path/extracted_packages/fake-release-package-name-3",
			}

			releaseJob.PackageNames = append(releaseJob.PackageNames, releasePackage3.Name)
			releaseJob.Packages = append(releaseJob.Packages, releasePackage3)
			releaseJobs = []bireljob.Job{releaseJob}
		})

		JustBeforeEach(func() {
			compiledPackageRecord3 := bistatepkg.CompiledPackageRecord{
				BlobID:   "fake-compiled-package-blobstore-id-3",
				BlobSHA1: "fake-compiled-package-sha1-3",
			}
			expectCompilePkg3 = mockPackageCompiler.EXPECT().Compile(releasePackage3).Return(compiledPackageRecord3, false, nil).AnyTimes()
		})

		It("only compiles each package once", func() {
			expectCompilePkg1.Times(1)
			expectCompilePkg2.After(expectCompilePkg1)
			expectCompilePkg3.After(expectCompilePkg1)

			_, err := dependencyCompiler.Compile(releaseJobs, fakeStage)
			Expect(err).ToNot(HaveOccurred())
		})
	})
})
开发者ID:hanzhefeng,项目名称:bosh-init,代码行数:30,代码来源:dependency_compiler_test.go


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