github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/integration/v7/plugin/help_test.go (about) 1 package plugin 2 3 import ( 4 "code.cloudfoundry.org/cli/integration/helpers" 5 . "github.com/onsi/ginkgo" 6 . "github.com/onsi/ginkgo/extensions/table" 7 . "github.com/onsi/gomega" 8 . "github.com/onsi/gomega/gbytes" 9 . "github.com/onsi/gomega/gexec" 10 ) 11 12 var _ = Describe("help", func() { 13 BeforeEach(func() { 14 installTestPlugin() 15 }) 16 17 AfterEach(func() { 18 uninstallTestPlugin() 19 }) 20 21 It("displays the plugin commands in master help", func() { 22 session := helpers.CF("help") 23 Eventually(session).Should(Say("TestPluginCommandWithAliasV7")) 24 Eventually(session).Should(Exit(0)) 25 }) 26 27 DescribeTable("displays individual plugin help", 28 func(helpCommand ...string) { 29 session := helpers.CF(helpCommand...) 30 Eventually(session).Should(Say("TestPluginCommandWithAliasV7")) 31 Eventually(session).Should(Say("This is my plugin help test. Banana.")) 32 Eventually(session).Should(Say("I R Usage")) 33 Eventually(session).Should(Say(`--dis-flag\s+is a flag`)) 34 Eventually(session).Should(Exit(0)) 35 }, 36 37 Entry("when passed to help", "help", "TestPluginCommandWithAliasV7"), 38 Entry("when passed -h", "TestPluginCommandWithAliasV7", "-h"), 39 Entry("when passed --help", "TestPluginCommandWithAliasV7", "--help"), 40 ) 41 })