spaceRoleSetter = commandregistry.Commands.FindCommand("set-space-role").(user.SpaceRoleSetter) spaceQuotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository) flagRepo = new(featureflagsfakes.FakeFeatureFlagRepository) requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedOrgSuccess: true} configOrg = models.OrganizationFields{ Name: "my-org", GUID: "my-org-guid", } //save original command and restore later OriginalCommand = commandregistry.Commands.FindCommand("set-space-role") spaceRepo = new(apifakes.FakeSpaceRepository) space := maker.NewSpace(maker.Overrides{"name": "my-space", "guid": "my-space-guid", "organization": configOrg}) spaceRepo.CreateReturns(space, nil) }) AfterEach(func() { commandregistry.Register(OriginalCommand) }) Describe("Requirements", func() { It("fails with usage when not provided exactly one argument", func() { runCommand() Expect(ui.Outputs).To(ContainSubstrings( []string{"Incorrect Usage", "Requires", "argument"}, )) }) Context("when not logged in", func() {