Esempio n. 1
0
	. "github.com/onsi/gomega"

	. "github.com/cloudfoundry/cli/testhelpers/matchers"
)

var _ = Describe("Push Command", func() {
	var (
		cmd                 *Push
		ui                  *testterm.FakeUI
		configRepo          configuration.ReadWriter
		manifestRepo        *testmanifest.FakeManifestRepository
		starter             *testcmd.FakeAppStarter
		stopper             *testcmd.FakeAppStopper
		serviceBinder       *testcmd.FakeAppBinder
		appRepo             *testapi.FakeApplicationRepository
		domainRepo          *testapi.FakeDomainRepository
		routeRepo           *testapi.FakeRouteRepository
		stackRepo           *testapi.FakeStackRepository
		serviceRepo         *testapi.FakeServiceRepo
		wordGenerator       words.WordGenerator
		requirementsFactory *testreq.FakeReqFactory
		authRepo            *testapi.FakeAuthenticationRepository
		actor               *fakeactors.FakePushActor
		app_files           *fakeappfiles.FakeAppFiles
		zipper              *fakeappfiles.FakeZipper
	)

	BeforeEach(func() {
		manifestRepo = &testmanifest.FakeManifestRepository{}
		starter = &testcmd.FakeAppStarter{}
		stopper = &testcmd.FakeAppStopper{}
		serviceBinder = &testcmd.FakeAppBinder{}
Esempio n. 2
0
	. "github.com/cloudfoundry/cli/cf/commands"
	"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("stacks command", func() {
	var (
		ui                  *testterm.FakeUI
		cmd                 ListStacks
		repo                *testapi.FakeStackRepository
		requirementsFactory *testreq.FakeReqFactory
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		config := testconfig.NewRepositoryWithDefaults()
		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
		repo = &testapi.FakeStackRepository{}
		cmd = NewListStacks(ui, config, repo)
	})

	Describe("login requirements", func() {
		It("fails if the user is not logged in", func() {
			requirementsFactory.LoginSuccess = false
			testcmd.RunCommand(cmd, []string{}, requirementsFactory)