本文整理匯總了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())
})
})
})