github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/integration/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  	It("displays the plugin commands in master help", func() {
    14  		session := helpers.CF("help")
    15  		Eventually(session).Should(Say("TestPluginCommandWithAlias"))
    16  		Eventually(session).Should(Exit(0))
    17  	})
    18  
    19  	DescribeTable("displays indivual plugin help",
    20  		func(helpCommand ...string) {
    21  			session := helpers.CF(helpCommand...)
    22  			Eventually(session).Should(Say("TestPluginCommandWithAlias"))
    23  			Eventually(session).Should(Say("This is my plugin help test. Banana."))
    24  			Eventually(session).Should(Say("I R Usage"))
    25  			Eventually(session).Should(Say("--dis-flag\\s+is a flag"))
    26  			Eventually(session).Should(Exit(0))
    27  		},
    28  
    29  		Entry("when passed to help", "help", "TestPluginCommandWithAlias"),
    30  		Entry("when when passed -h", "TestPluginCommandWithAlias", "-h"),
    31  		Entry("when when passed --help", "TestPluginCommandWithAlias", "--help"),
    32  	)
    33  })