本文整理汇总了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())
示例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())
})
})
})