Example #1
0
	. "github.com/nttlabs/cli/cf/commands/service"
	"github.com/nttlabs/cli/cf/models"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	testconfig "github.com/nttlabs/cli/testhelpers/configuration"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

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

var _ = Describe("delete-service command", func() {
	var (
		ui                  *testterm.FakeUI
		requirementsFactory *testreq.FakeReqFactory
		serviceRepo         *testapi.FakeServiceRepo
		serviceInstance     models.ServiceInstance
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{
			Inputs: []string{"yes"},
		}

		serviceRepo = &testapi.FakeServiceRepo{}
		requirementsFactory = &testreq.FakeReqFactory{
			LoginSuccess: true,
		}
	})

	runCommand := func(args ...string) {
	"github.com/nttlabs/cli/cf/errors"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	testconfig "github.com/nttlabs/cli/testhelpers/configuration"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

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

var _ = Describe("migrating service instances from v1 to v2", func() {
	var (
		ui                  *testterm.FakeUI
		serviceRepo         *testapi.FakeServiceRepo
		cmd                 *MigrateServiceInstances
		requirementsFactory *testreq.FakeReqFactory
		args                []string
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		config := testconfig.NewRepository()
		serviceRepo = &testapi.FakeServiceRepo{}
		cmd = NewMigrateServiceInstances(ui, config, serviceRepo)
		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: false}
		args = []string{}
	})

	Describe("requirements", func() {
		It("requires you to be logged in", func() {
Example #3
0
import (
	plan_builder_fakes "github.com/nttlabs/cli/cf/actors/plan_builder/fakes"
	"github.com/nttlabs/cli/cf/actors/service_builder"
	testapi "github.com/nttlabs/cli/cf/api/fakes"

	"github.com/nttlabs/cli/cf/models"

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

var _ = Describe("Service Builder", func() {
	var (
		planBuilder    *plan_builder_fakes.FakePlanBuilder
		serviceBuilder service_builder.ServiceBuilder
		serviceRepo    *testapi.FakeServiceRepo
		service1       models.ServiceOffering
		plan1          models.ServicePlanFields
		plan2          models.ServicePlanFields
	)

	BeforeEach(func() {
		serviceRepo = &testapi.FakeServiceRepo{}
		planBuilder = &plan_builder_fakes.FakePlanBuilder{}

		serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
		service1 = models.ServiceOffering{
			ServiceOfferingFields: models.ServiceOfferingFields{
				Label:      "my-service1",
				Guid:       "service-guid1",
				BrokerGuid: "my-service-broker-guid1",
			},
Example #4
0
	"github.com/nttlabs/cli/cf/models"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	testconfig "github.com/nttlabs/cli/testhelpers/configuration"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

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

var _ = Describe("update-service command", func() {
	var (
		ui                  *testterm.FakeUI
		config              core_config.Repository
		requirementsFactory *testreq.FakeReqFactory
		serviceRepo         *testapi.FakeServiceRepo
		planBuilder         *testplanbuilder.FakePlanBuilder
		offering1           models.ServiceOffering
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		config = testconfig.NewRepositoryWithDefaults()
		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
		serviceRepo = &testapi.FakeServiceRepo{}
		planBuilder = &testplanbuilder.FakePlanBuilder{}

		offering1 = models.ServiceOffering{}
		offering1.Label = "cleardb"
		offering1.Plans = []models.ServicePlanFields{{
			Name: "spark",
Example #5
0
	. "github.com/nttlabs/cli/testhelpers/matchers"
)

var _ = Describe("Push Command", func() {
	var (
		cmd                 *Push
		ui                  *testterm.FakeUI
		configRepo          core_config.ReadWriter
		manifestRepo        *testmanifest.FakeManifestRepository
		starter             *testcmd.FakeApplicationStarter
		stopper             *testcmd.FakeApplicationStopper
		serviceBinder       *testcmd.FakeAppBinder
		appRepo             *testApplication.FakeApplicationRepository
		domainRepo          *testapi.FakeDomainRepository
		routeRepo           *testapi.FakeRouteRepository
		stackRepo           *testStacks.FakeStackRepository
		serviceRepo         *testapi.FakeServiceRepo
		wordGenerator       *testwords.FakeWordGenerator
		requirementsFactory *testreq.FakeReqFactory
		authRepo            *testapi.FakeAuthenticationRepository
		actor               *fakeactors.FakePushActor
		app_files           *fakeappfiles.FakeAppFiles
		zipper              *fakeappfiles.FakeZipper
		zoneRepo            *testapi.FakeZoneRepository
	)

	BeforeEach(func() {
		manifestRepo = &testmanifest.FakeManifestRepository{}
		starter = &testcmd.FakeApplicationStarter{}
		stopper = &testcmd.FakeApplicationStopper{}