コード例 #1
0
			config.UsernameReturns("my-user")
		})

		JustBeforeEach(func() {
			cmd.SetDependency(deps, false)
			runCLIErr = cmd.Execute(flagContext)
		})

		Context("when creating a quota succeeds", func() {
			Context("without any flags", func() {
				BeforeEach(func() {
					flagContext.Parse("my-quota")
				})

				It("creates a quota with a given name", func() {
					Expect(quotaRepo.CreateArgsForCall(0).Name).To(Equal("my-quota"))
					Expect(quotaRepo.CreateArgsForCall(0).OrgGUID).To(Equal("my-org-guid"))
					Expect(ui.Outputs()).To(ContainSubstrings(
						[]string{"Creating space quota", "my-quota", "my-org", "my-user", "..."},
						[]string{"OK"},
					))
				})

				It("sets the instance memory limit to unlimiited", func() {
					Expect(quotaRepo.CreateArgsForCall(0).InstanceMemoryLimit).To(Equal(int64(-1)))
				})

				It("sets the instance limit to unlimited", func() {
					Expect(quotaRepo.CreateArgsForCall(0).AppInstanceLimit).To(Equal(resources.UnlimitedAppInstances))
				})