Пример #1
0
	testmanifest "testhelpers/manifest"
	testreq "testhelpers/requirements"
	testterm "testhelpers/terminal"
	testwords "testhelpers/words"
	"words"
)

var _ = Describe("Push Command", func() {
	var (
		cmd           *Push
		ui            *testterm.FakeUI
		configRepo    configuration.ReadWriter
		manifestRepo  *testmanifest.FakeManifestRepository
		starter       *testcmd.FakeAppStarter
		stopper       *testcmd.FakeAppStopper
		binder        *testcmd.FakeAppBinder
		appRepo       *testapi.FakeApplicationRepository
		domainRepo    *testapi.FakeDomainRepository
		routeRepo     *testapi.FakeRouteRepository
		stackRepo     *testapi.FakeStackRepository
		appBitsRepo   *testapi.FakeApplicationBitsRepository
		serviceRepo   *testapi.FakeServiceRepo
		wordGenerator words.WordGenerator
	)

	BeforeEach(func() {
		manifestRepo = &testmanifest.FakeManifestRepository{}
		starter = &testcmd.FakeAppStarter{}
		stopper = &testcmd.FakeAppStopper{}
		binder = &testcmd.FakeAppBinder{}
		appRepo = &testapi.FakeApplicationRepository{}
Пример #2
0
	. "cf/commands"
	"cf/models"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	testapi "testhelpers/api"
	testassert "testhelpers/assert"
	testcmd "testhelpers/commands"
	testconfig "testhelpers/configuration"
	testreq "testhelpers/requirements"
	testterm "testhelpers/terminal"
)

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
			context := testcmd.NewContext("stacks", []string{})