예제 #1
0
	"code.cloudfoundry.org/cli/cf/requirements/requirementsfakes"
	testcmd "code.cloudfoundry.org/cli/testhelpers/commands"
	testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
	testterm "code.cloudfoundry.org/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"code.cloudfoundry.org/cli/cf/commands"
	. "code.cloudfoundry.org/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)
예제 #2
0
	testconfig "code.cloudfoundry.org/cli/testhelpers/configuration"
	testterm "code.cloudfoundry.org/cli/testhelpers/terminal"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"code.cloudfoundry.org/cli/cf/commandregistry"
	"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
	. "code.cloudfoundry.org/cli/testhelpers/matchers"
)

var _ = Describe("stack command", func() {
	var (
		ui                  *testterm.FakeUI
		config              coreconfig.Repository
		repo                *stacksfakes.FakeStackRepository
		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("stack").SetDependency(deps, pluginCall))
	}

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		config = testconfig.NewRepositoryWithDefaults()
		requirementsFactory = new(requirementsfakes.FakeFactory)
예제 #3
0
파일: app_test.go 프로젝트: fujitsu-cf/cli
	. "code.cloudfoundry.org/cli/testhelpers/matchers"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("App", func() {
	var (
		ui               *testterm.FakeUI
		appSummaryRepo   *apifakes.FakeAppSummaryRepository
		appInstancesRepo *appinstancesfakes.FakeAppInstancesRepository
		stackRepo        *stacksfakes.FakeStackRepository
		getAppModel      *plugin_models.GetAppModel

		cmd         commandregistry.Command
		deps        commandregistry.Dependency
		factory     *requirementsfakes.FakeFactory
		flagContext flags.FlagContext

		loginRequirement         requirements.Requirement
		targetedSpaceRequirement requirements.Requirement
		applicationRequirement   *requirementsfakes.FakeApplicationRequirement
	)

	BeforeEach(func() {
		cmd = &application.ShowApp{}
		flagContext = flags.NewFlagContext(cmd.MetaData().Flags)

		ui = &testterm.FakeUI{}

		getAppModel = &plugin_models.GetAppModel{}
예제 #4
0
	. "code.cloudfoundry.org/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)