github.com/sleungcy-sap/cli@v7.1.0+incompatible/integration/v7/isolated/error_on_extra_arguments_test.go (about)

     1  package isolated
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/integration/helpers"
     5  	. "github.com/onsi/ginkgo/extensions/table"
     6  	. "github.com/onsi/gomega"
     7  	. "github.com/onsi/gomega/gbytes"
     8  	. "github.com/onsi/gomega/gexec"
     9  )
    10  
    11  var _ = DescribeTable("error when extra arguments passed to command",
    12  	func(cmd string) {
    13  		helpers.SetupCF(ReadOnlyOrg, ReadOnlySpace)
    14  		session := helpers.CF(cmd, "aaaa", "bbbbb", "ccccc", "ddddd", "eeeeee", "fffff")
    15  
    16  		Eventually(session.Err).Should(Say(`Incorrect Usage: unexpected argument "[abcdef\s]+"`))
    17  		Eventually(session).Should(Say("FAILED"))
    18  		Eventually(session).Should(Exit(1))
    19  	},
    20  	Entry("for refactored commands", "orgs"),
    21  	Entry("for non-refactored commands", "feature-flag"),
    22  	Entry("for V3'd command", "push"),
    23  )