Ejemplo n.º 1
0
		configOrg = models.OrganizationFields{
			Name: "my-org",
			Guid: "my-org-guid",
		}

		configSpace = models.SpaceFields{
			Name: "config-space",
			Guid: "config-space-guid",
		}

		//save original command and restore later
		OriginalCommand = command_registry.Commands.FindCommand("set-space-role")

		spaceRepo = &testapi.FakeSpaceRepository{}
		space := maker.NewSpace(maker.Overrides{"name": "my-space", "guid": "my-space-guid", "organization": configOrg})
		spaceRepo.CreateReturns(space, nil)
	})

	AfterEach(func() {
		command_registry.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() {