}) It("returns a SpaceRequirement", func() { actualRequirements, err := cmd.Requirements(factory, flagContext) Expect(err).NotTo(HaveOccurred()) Expect(factory.NewSpaceRequirementCallCount()).To(Equal(1)) Expect(factory.NewSpaceRequirementArgsForCall(0)).To(Equal("space-name")) Expect(actualRequirements).To(ContainElement(spaceRequirement)) }) It("returns a DomainRequirement", func() { actualRequirements, err := cmd.Requirements(factory, flagContext) Expect(err).NotTo(HaveOccurred()) Expect(factory.NewDomainRequirementCallCount()).To(Equal(1)) Expect(factory.NewDomainRequirementArgsForCall(0)).To(Equal("domain-name")) Expect(actualRequirements).To(ContainElement(domainRequirement)) }) }) Context("when the --path option is given", func() { BeforeEach(func() { flagContext.Parse("space-name", "domain-name", "--path", "path") }) It("returns a MinAPIVersionRequirement", func() { expectedVersion, err := semver.Make("2.36.0") Expect(err).NotTo(HaveOccurred()) actualRequirements, err := cmd.Requirements(factory, flagContext)