github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/integration/isolated/proxy_connection_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("proxy", func() { 12 var proxyURL string 13 14 BeforeEach(func() { 15 proxyURL = "http://127.0.0.1:9999" 16 }) 17 18 Context("V2 Legacy", func() { 19 It("handles a proxy", func() { 20 Skip("Figure out how to test not using API command") 21 helpers.SkipIfExperimental("error messages have changed in refactored code") 22 session := helpers.CFWithEnv(map[string]string{"https_proxy": proxyURL}, "api", apiURL) 23 Eventually(session).Should(Say("Error performing request: Get %s/v2/info: http: error connecting to proxy %s", apiURL, proxyURL)) 24 Eventually(session).Should(Exit(1)) 25 }) 26 }) 27 28 Context("V2", func() { 29 It("handles a proxy", func() { 30 session := helpers.CFWithEnv(map[string]string{"https_proxy": proxyURL}, "api", apiURL) 31 Eventually(session.Err).Should(Say("Get %s/v2/info: http: error connecting to proxy %s", apiURL, proxyURL)) 32 Eventually(session).Should(Exit(1)) 33 }) 34 }) 35 36 Context("V3", func() { 37 It("handles a proxy", func() { 38 session := helpers.CFWithEnv(map[string]string{"https_proxy": proxyURL}, "run-task", "app", "echo") 39 Eventually(session.Err).Should(Say("Get %s: http: error connecting to proxy %s", apiURL, proxyURL)) 40 Eventually(session).Should(Exit(1)) 41 }) 42 }) 43 })