github.com/arunkumar7540/cli@v6.45.0+incompatible/integration/shared/isolated/table_alignment_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("table alignment", func() { 12 BeforeEach(func() { 13 helpers.LoginCF() 14 }) 15 16 When("output is in English", func() { 17 BeforeEach(func() { 18 helpers.LoginCF() 19 helpers.TargetOrgAndSpace(ReadOnlyOrg, ReadOnlySpace) 20 }) 21 22 // Developer note: The spacing in this test is significant and explicit. Do 23 // not replace with a regex. 24 It("aligns the table correctly", func() { 25 username, _ := helpers.GetCredentials() 26 session := helpers.CF("target") 27 Eventually(session).Should(Say("api endpoint: %s", apiURL)) 28 Eventually(session).Should(Say(`api version: [\d.]+`)) 29 Eventually(session).Should(Say("user: %s", username)) 30 Eventually(session).Should(Say("org: %s", ReadOnlyOrg)) 31 Eventually(session).Should(Say("space: %s", ReadOnlySpace)) 32 Eventually(session).Should(Exit(0)) 33 }) 34 }) 35 36 When("output is in language with multibyte characters", func() { 37 BeforeEach(func() { 38 helpers.LoginCF() 39 helpers.TargetOrgAndSpace(ReadOnlyOrg, ReadOnlySpace) 40 }) 41 42 // Developer note: The spacing in this test is significant and explicit. Do 43 // not replace with a regex. 44 // TODO: add these strings to the i18n/resources 45 // See: https://www.pivotaltracker.com/story/show/151737497 46 XIt("aligns the table correctly", func() { 47 username, _ := helpers.GetCredentials() 48 session := helpers.CFWithEnv(map[string]string{"LANG": "ja-JP.utf8"}, "target") 49 Eventually(session).Should(Say("API エンドポイント: %s", apiURL)) 50 Eventually(session).Should(Say(`api version: [\d.]+`)) 51 Eventually(session).Should(Say("ユーザー: %s", username)) 52 Eventually(session).Should(Say("組織: %s", ReadOnlyOrg)) 53 Eventually(session).Should(Say("スペース: %s", ReadOnlySpace)) 54 Eventually(session).Should(Exit(0)) 55 }) 56 }) 57 })