本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/commandregistry.Dependency类的典型用法代码示例。如果您正苦于以下问题:Golang Dependency类的具体用法?Golang Dependency怎么用?Golang Dependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dependency类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("bind-service command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
config coreconfig.Repository
serviceBindingRepo *apifakes.FakeServiceBindingRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetServiceBindingRepository(serviceBindingRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("bind-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:bind_service_test.go
示例2:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("restart-app-instance", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
requirementsFactory *requirementsfakes.FakeFactory
application models.Application
deps commandregistry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
appInstancesRepo = new(appinstancesfakes.FakeAppInstancesRepository)
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
requirementsFactory.NewTargetedSpaceRequirementReturns(requirements.Passing{})
application = models.Application{}
application.Name = "my-app"
开发者ID:Reejoshi,项目名称:cli,代码行数:32,代码来源:restart_app_instance_test.go
示例3:
"github.com/cloudfoundry/cli/cf/terminal"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/route"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo).SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("routes").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:jasonkeene,项目名称:cli,代码行数:32,代码来源:routes_test.go
示例4:
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
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("update-security-group command", func() {
var (
ui *testterm.FakeUI
securityGroupRepo *securitygroupsfakes.FakeSecurityGroupRepo
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetSecurityGroupRepository(securityGroupRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-security-group").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = new(requirementsfakes.FakeFactory)
securityGroupRepo = new(securitygroupsfakes.FakeSecurityGroupRepo)
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:update_security_group_test.go
示例5: failedUpdate
[]string{"OK"},
))
}
func failedUpdate(ui *testterm.FakeUI, buildpackName string) {
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Updating buildpack", buildpackName},
[]string{"FAILED"},
))
}
var _ = Describe("Updating buildpack command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
ui *testterm.FakeUI
repo *apifakes.OldFakeBuildpackRepository
bitsRepo *apifakes.OldFakeBuildpackBitsRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(repo)
deps.RepoLocator = deps.RepoLocator.SetBuildpackBitsRepository(bitsRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-buildpack").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, BuildpackSuccess: true}
ui = new(testterm.FakeUI)
repo = new(apifakes.OldFakeBuildpackRepository)
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:update_buildpack_test.go
示例6:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Login Command", func() {
var (
Flags []string
Config coreconfig.Repository
ui *testterm.FakeUI
authRepo *authenticationfakes.FakeAuthenticationRepository
endpointRepo *coreconfigfakes.FakeEndpointRepository
orgRepo *organizationsfakes.FakeOrganizationRepository
spaceRepo *apifakes.FakeSpaceRepository
org models.Organization
deps commandregistry.Dependency
minCLIVersion string
minRecommendedCLIVersion string
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = Config
deps.RepoLocator = deps.RepoLocator.SetEndpointRepository(endpointRepo)
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:login_test.go
示例7:
"github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-service-broker command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
brokerRepo *apifakes.FakeServiceBrokerRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceBrokerRepository(brokerRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service-broker").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
brokerRepo = new(apifakes.FakeServiceBrokerRepository)
configRepo = testconfig.NewRepositoryWithDefaults()
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:delete_service_broker_test.go
示例8:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-user command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
userRepo *apifakes.FakeUserRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetUserRepository(userRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-user").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
userRepo = new(apifakes.FakeUserRepository)
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:delete_user_test.go
示例9:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/service"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("update-service command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
planBuilder *planbuilderfakes.FakePlanBuilder
offering1 models.ServiceOffering
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
deps.PlanBuilder = planBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:update_service_test.go
示例10:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commands/serviceauthtoken"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("service-auth-tokens command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
authTokenRepo *apifakes.OldFakeAuthTokenRepo
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceAuthTokenRepository(authTokenRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("service-auth-tokens").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = new(apifakes.OldFakeAuthTokenRepo)
configRepo = testconfig.NewRepositoryWithDefaults()
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:service_auth_tokens_test.go
示例11:
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
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("disallow-space-ssh command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
spaceRepo *apifakes.FakeSpaceRepository
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
spaceRepo = new(apifakes.FakeSpaceRepository)
})
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
开发者ID:jsloyer,项目名称:cli,代码行数:31,代码来源:disallow_space_ssh_test.go
示例12:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("stacks command", func() {
var (
ui *testterm.FakeUI
repo *stacksfakes.FakeStackRepository
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetStackRepository(repo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("stacks").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:stacks_test.go
示例13:
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("password command", func() {
var (
pwDeps passwordDeps
ui *testterm.FakeUI
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = pwDeps.Config
deps.RepoLocator = deps.RepoLocator.SetPasswordRepository(pwDeps.PwdRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("passwd").SetDependency(deps, pluginCall))
}
callPassword := func(inputs []string, pwDeps passwordDeps) (*testterm.FakeUI, bool) {
ui = &testterm.FakeUI{Inputs: inputs}
passed := testcmd.RunCLICommand("passwd", []string{}, pwDeps.ReqFactory, updateCommandDependency, false, ui)
return ui, passed
}
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:passwd_test.go
示例14:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
"github.com/cloudfoundry/cli/cf/commands/serviceaccess"
"github.com/cloudfoundry/cli/cf/configuration/coreconfig"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("service-access command", func() {
var (
ui *testterm.FakeUI
actor *actorsfakes.FakeServiceActor
requirementsFactory *testreq.FakeReqFactory
serviceBroker1 models.ServiceBroker
serviceBroker2 models.ServiceBroker
authRepo *authenticationfakes.FakeAuthenticationRepository
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.ServiceHandler = actor
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("service-access").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
开发者ID:yingkitw,项目名称:cli,代码行数:32,代码来源:service_access_test.go
示例15:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commands/spacequota"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("quotas command", func() {
var (
ui *testterm.FakeUI
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceQuotaRepository(quotaRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("space-quotas").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository)
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:space_quotas_test.go
示例16:
"github.com/cloudfoundry/cli/plugin/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/organization"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("orgs command", func() {
var (
ui *testterm.FakeUI
orgRepo *organizationsfakes.FakeOrganizationRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("orgs").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("orgs", args, requirementsFactory, updateCommandDependency, false, ui)
}
开发者ID:jasonkeene,项目名称:cli,代码行数:30,代码来源:orgs_test.go
示例17:
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/application"
"github.com/cloudfoundry/cli/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
"os"
)
var _ = Describe("list-apps command", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
appSummaryRepo *apifakes.OldFakeAppSummaryRepo
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetAppSummaryRepository(appSummaryRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("apps").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
appSummaryRepo = new(apifakes.OldFakeAppSummaryRepo)
configRepo = testconfig.NewRepositoryWithDefaults()
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:apps_test.go
示例18:
"github.com/cloudfoundry/cli/flags"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-space-quota command", func() {
var (
ui *testterm.FakeUI
spaceRepo *spacesfakes.FakeSpaceRepository
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo *coreconfigfakes.FakeRepository
deps commandregistry.Dependency
cmd spacequota.SetSpaceQuota
flagContext flags.FlagContext
loginReq requirements.Requirement
orgReq *requirementsfakes.FakeTargetedOrgRequirement
)
BeforeEach(func() {
requirementsFactory = new(requirementsfakes.FakeFactory)
loginReq = requirements.Passing{Type: "login"}
requirementsFactory.NewLoginRequirementReturns(loginReq)
orgReq = new(requirementsfakes.FakeTargetedOrgRequirement)
requirementsFactory.NewTargetedOrgRequirementReturns(orgReq)
ui = new(testterm.FakeUI)
开发者ID:Reejoshi,项目名称:cli,代码行数:32,代码来源:set_space_quota_test.go
示例19:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"os"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("OauthToken", func() {
var (
ui *testterm.FakeUI
authRepo *authenticationfakes.FakeRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("oauth-token").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
fakeLogger := new(tracefakes.FakePrinter)
authRepo = new(authenticationfakes.FakeRepository)
开发者ID:jsloyer,项目名称:cli,代码行数:31,代码来源:oauth_token_test.go
示例20:
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("feature-flags command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
flagRepo *featureflagsfakes.FakeFeatureFlagRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetFeatureFlagRepository(flagRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("feature-flags").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:feature_flags_test.go
注:本文中的github.com/cloudfoundry/cli/cf/commandregistry.Dependency类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论