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

var _ = Describe("API Command", func() {
	var (
		cmd        ApiCommand
		fakeUI     *ui.UI
		fakeActor  *v2fakes.FakeAPIConfigActor
		fakeConfig *commandsfakes.FakeConfig
		err        error
	)

	BeforeEach(func() {
		out := NewBuffer()
		fakeUI = ui.NewTestUI(nil, out, out)
		fakeActor = new(v2fakes.FakeAPIConfigActor)
		fakeConfig = new(commandsfakes.FakeConfig)
		fakeConfig.ExperimentalReturns(true)

		cmd = ApiCommand{
			UI:     fakeUI,
			Actor:  fakeActor,
			Config: fakeConfig,
		}
	})

	JustBeforeEach(func() {
		err = cmd.Execute(nil)
	})
Esempio n. 2
0
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
)

var _ = Describe("Help Command", func() {
	var (
		fakeUI     *ui.UI
		fakeActor  *v2fakes.FakeHelpActor
		cmd        HelpCommand
		fakeConfig *commandsfakes.FakeConfig
	)

	BeforeEach(func() {
		fakeUI = ui.NewTestUI(NewBuffer(), NewBuffer())
		fakeActor = new(v2fakes.FakeHelpActor)
		fakeConfig = new(commandsfakes.FakeConfig)
		fakeConfig.BinaryNameReturns("faceman")

		cmd = HelpCommand{
			UI:     fakeUI,
			Actor:  fakeActor,
			Config: fakeConfig,
		}
	})

	Context("providing help for a specific command", func() {
		Describe("built-in command", func() {
			BeforeEach(func() {
				cmd.OptionalArgs = flags.CommandName{
Esempio n. 3
0
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
)

var _ = Describe("API Command", func() {
	var (
		cmd        ApiCommand
		fakeUI     *ui.UI
		fakeActor  *v2fakes.FakeAPIConfigActor
		fakeConfig *commandsfakes.FakeConfig
	)

	BeforeEach(func() {
		out := NewBuffer()
		fakeUI = ui.NewTestUI(out, out)
		fakeActor = new(v2fakes.FakeAPIConfigActor)
		fakeConfig = new(commandsfakes.FakeConfig)
		fakeConfig.ExperimentalReturns(true)

		cmd = ApiCommand{
			UI:     fakeUI,
			Actor:  fakeActor,
			Config: fakeConfig,
		}
	})

	Context("when the API URL is not provided", func() {
		var err error
		JustBeforeEach(func() {
			err = cmd.Execute([]string{})
)

var _ = Describe("DeletedOrphanedRoutes Command", func() {
	var (
		cmd        v2.DeleteOrphanedRoutesCommand
		fakeUI     *ui.UI
		fakeActor  *v2fakes.FakeDeleteOrphanedRoutesActor
		fakeConfig *commandsfakes.FakeConfig
		input      *Buffer
		executeErr error
	)

	BeforeEach(func() {
		input = NewBuffer()
		out := NewBuffer()
		fakeUI = ui.NewTestUI(input, out, out)
		fakeActor = new(v2fakes.FakeDeleteOrphanedRoutesActor)
		fakeConfig = new(commandsfakes.FakeConfig)
		fakeConfig.ExperimentalReturns(true)

		cmd = v2.DeleteOrphanedRoutesCommand{
			UI:     fakeUI,
			Actor:  fakeActor,
			Config: fakeConfig,
		}
	})

	JustBeforeEach(func() {
		executeErr = cmd.Execute(nil)
	})