Beispiel #1
0
				keepGoing = cb(s)
				if !keepGoing {
					break
				}
			}
			return nil
		}
	}

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		orgRepo = new(organizationsfakes.FakeOrganizationRepository)
		spaceRepo = new(apifakes.FakeSpaceRepository)
		requirementsFactory = new(testreq.FakeReqFactory)
		config = testconfig.NewRepositoryWithDefaults()
		requirementsFactory.APIEndpointSuccess = true
	})

	var callTarget = func(args []string) bool {
		return testcmd.RunCLICommand("target", args, requirementsFactory, updateCommandDependency, false)
	}

	Context("when there are too many arguments given", func() {
		var cmd commandregistry.Command
		var flagContext flags.FlagContext

		BeforeEach(func() {
			cmd = &commands.Target{}
			cmd.SetDependency(deps, false)
			flagContext = flags.NewFlagContext(cmd.MetaData().Flags)