github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/command/v6/service_auth_tokens_command_test.go (about) 1 package v6_test 2 3 import ( 4 "code.cloudfoundry.org/cli/command/translatableerror" 5 . "code.cloudfoundry.org/cli/command/v6" 6 "code.cloudfoundry.org/cli/util/ui" 7 . "github.com/onsi/ginkgo" 8 . "github.com/onsi/gomega" 9 . "github.com/onsi/gomega/gbytes" 10 ) 11 12 var _ = Describe("Service Auth Tokens Command", func() { 13 var ( 14 cmd ServiceAuthTokensCommand 15 testUI *ui.UI 16 ) 17 18 BeforeEach(func() { 19 testUI = ui.NewTestUI(nil, NewBuffer(), NewBuffer()) 20 21 cmd = ServiceAuthTokensCommand{ 22 UI: testUI, 23 } 24 }) 25 26 When("command is called in v6", func() { 27 It("returns an unrefactored command error", func() { 28 err := cmd.Execute(nil) 29 Expect(err).To(MatchError(translatableerror.UnrefactoredCommandError{})) 30 }) 31 32 It("displays a deprecation warning", func() { 33 _ = cmd.Execute(nil) 34 Expect(testUI.Err).To(Say("Deprecation warning: This command has been deprecated. This feature will be removed in the future.")) 35 }) 36 }) 37 })