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{}
import ( . "cf/commands/route" "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("delete-route command", func() { var routeRepo *testapi.FakeRouteRepository var reqFactory *testreq.FakeReqFactory BeforeEach(func() { routeRepo = &testapi.FakeRouteRepository{} reqFactory = &testreq.FakeReqFactory{} }) It("fails requirements when not logged in", func() { callDeleteRoute("y", []string{"-n", "my-host", "example.com"}, reqFactory, routeRepo) Expect(testcmd.CommandDidPassRequirements).To(BeFalse()) }) Context("when logged in successfully", func() { var ui *testterm.FakeUI
. "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("delete app command", func() { var ( cmd *DeleteApp ui *testterm.FakeUI app models.Application configRepo configuration.ReadWriter appRepo *testapi.FakeApplicationRepository routeRepo *testapi.FakeRouteRepository requirementsFactory *testreq.FakeReqFactory ) BeforeEach(func() { app = models.Application{} app.Name = "app-to-delete" app.Guid = "app-to-delete-guid" ui = &testterm.FakeUI{} appRepo = &testapi.FakeApplicationRepository{} routeRepo = &testapi.FakeRouteRepository{} requirementsFactory = &testreq.FakeReqFactory{}
"cf/configuration" "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("routes command", func() { var ( ui *testterm.FakeUI routeRepo *testapi.FakeRouteRepository configRepo configuration.ReadWriter requirementsFactory *testreq.FakeReqFactory ) BeforeEach(func() { ui = &testterm.FakeUI{} configRepo = testconfig.NewRepositoryWithDefaults() requirementsFactory = &testreq.FakeReqFactory{ LoginSuccess: true, TargetedSpaceSuccess: true, } routeRepo = &testapi.FakeRouteRepository{} }) runCommand := func(args ...string) { cmd := NewListRoutes(ui, configRepo, routeRepo)