Пример #1
0
	testapi "github.com/nttlabs/cli/cf/api/fakes"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	"github.com/nttlabs/cli/testhelpers/configuration"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"

	. "github.com/nttlabs/cli/cf/commands/serviceaccess"
	. "github.com/nttlabs/cli/testhelpers/matchers"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("enable-service-access command", func() {
	var (
		ui                  *testterm.FakeUI
		actor               *testactor.FakeServicePlanActor
		requirementsFactory *testreq.FakeReqFactory
		tokenRefresher      *testapi.FakeAuthenticationRepository
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		actor = &testactor.FakeServicePlanActor{}
		requirementsFactory = &testreq.FakeReqFactory{}
		tokenRefresher = &testapi.FakeAuthenticationRepository{}
	})

	runCommand := func(args []string) bool {
		cmd := NewEnableServiceAccess(ui, configuration.NewRepositoryWithDefaults(), actor, tokenRefresher)
		return testcmd.RunCommand(cmd, args, requirementsFactory)
	}
Пример #2
0
	testactor "github.com/nttlabs/cli/cf/actors/fakes"
	testapi "github.com/nttlabs/cli/cf/api/fakes"
	. "github.com/nttlabs/cli/cf/commands/serviceaccess"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	"github.com/nttlabs/cli/testhelpers/configuration"
	. "github.com/nttlabs/cli/testhelpers/matchers"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("disable-service-access command", func() {
	var (
		ui                  *testterm.FakeUI
		actor               *testactor.FakeServicePlanActor
		requirementsFactory *testreq.FakeReqFactory
		tokenRefresher      *testapi.FakeAuthenticationRepository
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{
			Inputs: []string{"yes"},
		}
		actor = &testactor.FakeServicePlanActor{}
		requirementsFactory = &testreq.FakeReqFactory{}
		tokenRefresher = &testapi.FakeAuthenticationRepository{}
	})

	runCommand := func(args []string) bool {
		cmd := NewDisableServiceAccess(ui, configuration.NewRepositoryWithDefaults(), actor, tokenRefresher)
		return testcmd.RunCommand(cmd, args, requirementsFactory)