本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/commandregistry.Command类的典型用法代码示例。如果您正苦于以下问题:Golang Command类的具体用法?Golang Command怎么用?Golang Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Command类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(buildpackRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("buildpacks").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
buildpackRepo = new(apifakes.OldFakeBuildpackRepository)
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("buildpacks", args, requirementsFactory, updateCommandDependency, false)
}
Context("when arguments are provided", func() {
var cmd commandregistry.Command
var flagContext flags.FlagContext
BeforeEach(func() {
cmd = &buildpack.ListBuildpacks{}
cmd.SetDependency(deps, false)
flagContext = flags.NewFlagContext(cmd.MetaData().Flags)
})
It("should fail with usage", func() {
flagContext.Parse("blahblah")
reqs := cmd.Requirements(requirementsFactory, flagContext)
err := testcmd.RunRequirements(reqs)
Expect(err).To(HaveOccurred())
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:buildpacks_test.go
示例2:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnsetSpaceRole", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
userRepo *apifakes.FakeUserRepository
spaceRepo *apifakes.FakeSpaceRepository
flagRepo *featureflagsfakes.FakeFeatureFlagRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
userRequirement *requirementsfakes.FakeUserRequirement
organizationRequirement *requirementsfakes.FakeOrganizationRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
userRepo = new(apifakes.FakeUserRepository)
repoLocator := deps.RepoLocator.SetUserRepository(userRepo)
spaceRepo = new(apifakes.FakeSpaceRepository)
repoLocator = repoLocator.SetSpaceRepository(spaceRepo)
开发者ID:jsloyer,项目名称:cli,代码行数:32,代码来源:unset_space_role_test.go
示例3:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CreateUserProvidedService", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
serviceInstanceRepo *apifakes.FakeUserProvidedServiceInstanceRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = new(testterm.FakeUI)
configRepo = testconfig.NewRepositoryWithDefaults()
serviceInstanceRepo = new(apifakes.FakeUserProvidedServiceInstanceRepository)
repoLocator := deps.RepoLocator.SetUserProvidedServiceInstanceRepository(serviceInstanceRepo)
deps = commandregistry.Dependency{
UI: ui,
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:create_user_provided_service_test.go
示例4:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("SetSpaceRole", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
userRepo *apifakes.FakeUserRepository
spaceRepo *spacesfakes.FakeSpaceRepository
flagRepo *featureflagsfakes.FakeFeatureFlagRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
userRequirement *requirementsfakes.FakeUserRequirement
organizationRequirement *requirementsfakes.FakeOrganizationRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
userRepo = new(apifakes.FakeUserRepository)
repoLocator := deps.RepoLocator.SetUserRepository(userRepo)
spaceRepo = new(spacesfakes.FakeSpaceRepository)
repoLocator = repoLocator.SetSpaceRepository(spaceRepo)
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:set_space_role_test.go
示例5:
[]string{"FAILED"},
))
Expect(ui.WarnOutputs).To(ContainSubstrings([]string{"already exists"}))
})
})
})
Describe("Requirements", func() {
var (
requirementsFactory *requirementsfakes.FakeFactory
ui *testterm.FakeUI
cmd commandregistry.Command
deps commandregistry.Dependency
quotaRepo *quotasfakes.FakeQuotaRepository
flagContext flags.FlagContext
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
quotaRepo = new(quotasfakes.FakeQuotaRepository)
repoLocator := deps.RepoLocator.SetQuotaRepository(quotaRepo)
deps = commandregistry.Dependency{
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:create_quota_test.go
示例6:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CreateAppManifest", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
appSummaryRepo *apifakes.FakeAppSummaryRepository
stackRepo *stacksfakes.FakeStackRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
fakeManifest *manifestfakes.FakeApp
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
appSummaryRepo = new(apifakes.FakeAppSummaryRepository)
repoLocator := deps.RepoLocator.SetAppSummaryRepository(appSummaryRepo)
stackRepo = new(stacksfakes.FakeStackRepository)
开发者ID:Reejoshi,项目名称:cli,代码行数:30,代码来源:create_app_manifest_test.go
示例7:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CreateServiceBroker", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
serviceBrokerRepo *apifakes.FakeServiceBrokerRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceBrokerRepo = new(apifakes.FakeServiceBrokerRepository)
repoLocator := deps.RepoLocator.SetServiceBrokerRepository(serviceBrokerRepo)
deps = commandregistry.Dependency{
UI: ui,
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:create_service_broker_test.go
示例8:
import (
"github.com/cloudfoundry/cli/cf/commandregistry"
"github.com/cloudfoundry/cli/cf/commands"
"github.com/cloudfoundry/cli/cf/flags"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Version", func() {
var (
ui *testterm.FakeUI
cmd commandregistry.Command
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
deps := commandregistry.Dependency{
UI: ui,
}
cmd = &commands.Version{}
cmd.SetDependency(deps, false)
})
Describe("Execute", func() {
var flagContext flags.FlagContext
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:version_test.go
注:本文中的github.com/cloudfoundry/cli/cf/commandregistry.Command类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论