}) Context("when requirements have been met", func() { BeforeEach(func() { requirementsFactory.LoginSuccess = true requirementsFactory.TargetedOrgSuccess = true }) It("fails requirements when called without a quota name", func() { runCommand() Expect(ui.FailedWithUsage).To(BeTrue()) }) It("creates a quota with a given name", func() { runCommand("my-quota") 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-org", "my-quota", "my-user", "..."}, []string{"OK"}, )) }) Context("when the -m flag is provided", func() { It("sets the memory limit", func() { runCommand("-m", "50G", "erryday makin fitty jeez") Expect(quotaRepo.CreateArgsForCall(0).MemoryLimit).To(Equal(int64(51200))) }) It("alerts the user when parsing the memory limit fails", func() {