github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/integration/isolated/error_handling_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("curl command", func() { 12 It("returns the expected request", func() { 13 session := helpers.CF("curl", "/v2/banana") 14 Eventually(session).Should(Say(`"error_code": "CF-NotFound"`)) 15 Eventually(session).Should(Exit(0)) 16 }) 17 18 Context("when using -v", func() { 19 It("returns the expected request with verbose output", func() { 20 session := helpers.CF("curl", "-v", "/v2/banana") 21 Eventually(session).Should(Say("GET /v2/banana HTTP/1.1")) 22 Eventually(session).Should(Say(`"error_code": "CF-NotFound"`)) 23 Eventually(session).Should(Exit(0)) 24 }) 25 }) 26 })