github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/integration/isolated/update_buildpack_command_test.go (about) 1 package isolated 2 3 import ( 4 . "code.cloudfoundry.org/cli/integration/helpers" 5 . "github.com/onsi/ginkgo" 6 . "github.com/onsi/gomega" 7 . "github.com/onsi/gomega/gbytes" 8 . "github.com/onsi/gomega/gexec" 9 ) 10 11 var _ = Describe("unbind-service command", func() { 12 Context("when the buildpack is not provided", func() { 13 It("returns a buildpack argument not provided error", func() { 14 session := CF("update-buildpack", "-p", ".") 15 Eventually(session).Should(Exit(1)) 16 17 Expect(session.Err.Contents()).To(BeEquivalentTo("Incorrect Usage: the required argument `BUILDPACK` was not provided\n\n")) 18 }) 19 }) 20 21 Context("when the wrong data type is provided as the position argument", func() { 22 It("outputs an error message to the user, provides help text, and exits 1", func() { 23 session := CF("update-buildpack", "some-buildpack", "-i", "not-an-integer") 24 Eventually(session).Should(Exit(1)) 25 Expect(session.Err).To(Say("Incorrect Usage: invalid argument for flag `-i' \\(expected int\\)")) 26 Expect(session.Out).To(Say("cf update-buildpack BUILDPACK")) // help 27 }) 28 }) 29 })