flagContext = flags.NewFlagContext(cmd.MetaData().Flags) cmd = spacequota.SetSpaceQuota{} cmd.SetDependency(deps, false) configRepo.UsernameReturns("my-user") }) Describe("Requirements", func() { Context("when provided a quota and space", func() { var reqs []requirements.Requirement BeforeEach(func() { flagContext.Parse("space", "space-quota") reqs = cmd.Requirements(requirementsFactory, flagContext) }) It("returns a LoginRequirement", func() { Expect(reqs).To(ContainElement(loginReq)) }) It("requires the user to target an org", func() { Expect(reqs).To(ContainElement(orgReq)) }) }) Context("when not provided a quota and space", func() { BeforeEach(func() { flagContext.Parse("") })
cmd = spacequota.SetSpaceQuota{} cmd.SetDependency(deps, false) configRepo.UsernameReturns("my-user") }) Describe("Requirements", func() { Context("when provided a quota and space", func() { var reqs []requirements.Requirement BeforeEach(func() { var err error flagContext.Parse("space", "space-quota") reqs, err = cmd.Requirements(requirementsFactory, flagContext) Expect(err).NotTo(HaveOccurred()) }) It("returns a LoginRequirement", func() { Expect(reqs).To(ContainElement(loginReq)) }) It("requires the user to target an org", func() { Expect(reqs).To(ContainElement(orgReq)) }) }) Context("when not provided a quota and space", func() { BeforeEach(func() { flagContext.Parse("")