github.com/loafoe/cli@v7.1.0+incompatible/integration/shared/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  	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  })