예제 #1
0
	testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
	"github.com/cloudfoundry/cli/testhelpers/maker"
	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("scale command", func() {
	var (
		requirementsFactory *testreq.FakeReqFactory
		restarter           *testcmd.FakeApplicationRestarter
		appRepo             *testApplication.FakeApplicationRepository
		ui                  *testterm.FakeUI
		config              core_config.ReadWriter
		cmd                 *Scale
		app                 models.Application
	)

	BeforeEach(func() {
		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
		restarter = &testcmd.FakeApplicationRestarter{}
		appRepo = &testApplication.FakeApplicationRepository{}
		ui = new(testterm.FakeUI)
		config = testconfig.NewRepositoryWithDefaults()
		cmd = NewScale(ui, config, restarter, appRepo)
	})

	Describe("requirements", func() {
예제 #2
0
	"github.com/cloudfoundry/cli/cf/errors"

	. "github.com/cloudfoundry/cli/testhelpers/matchers"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("CopySource", func() {

	var (
		ui                  *testterm.FakeUI
		config              core_config.Repository
		requirementsFactory *testreq.FakeReqFactory
		authRepo            *testapi.FakeAuthenticationRepository
		appRepo             *testApplication.FakeApplicationRepository
		copyAppSourceRepo   *testCopyApplication.FakeCopyApplicationSourceRepository
		spaceRepo           *testapi.FakeSpaceRepository
		orgRepo             *testorg.FakeOrganizationRepository
		appRestarter        *testcmd.FakeApplicationRestarter
		OriginalCommand     command_registry.Command
		deps                command_registry.Dependency
	)

	updateCommandDependency := func(pluginCall bool) {
		deps.Ui = ui
		deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
		deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
		deps.RepoLocator = deps.RepoLocator.SetCopyApplicationSourceRepository(copyAppSourceRepo)
		deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
		deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
		deps.Config = config