github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/requirements/unsupported_legacy_flag_test.go (about) 1 package requirements_test 2 3 import ( 4 "code.cloudfoundry.org/cli/cf/requirements" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("UnsupportedLegacyFlagRequirement", func() { 11 var ( 12 flags []string 13 requirement requirements.UnsupportedLegacyFlagRequirement 14 ) 15 16 BeforeEach(func() { 17 flags = []string{ 18 "--flag-1", 19 "--flag-2", 20 "--flag-3", 21 } 22 requirement = requirements.NewUnsupportedLegacyFlagRequirement(flags) 23 }) 24 25 Context("Execute", func() { 26 It("always returns an error", func() { 27 Expect(requirement.Execute()).To(MatchError("The following flags cannot be used with deprecated usage: --flag-1, --flag-2, --flag-3")) 28 }) 29 }) 30 })