github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/main/locales_test.go (about)

     1  package main_test
     2  
     3  import (
     4  	"os"
     5  	"time"
     6  
     7  	"github.com/cloudfoundry/cli/cf/i18n"
     8  
     9  	. "github.com/onsi/ginkgo"
    10  	. "github.com/onsi/gomega"
    11  	. "github.com/onsi/gomega/gexec"
    12  )
    13  
    14  var _ = Describe("locales", func() {
    15  	var oldLocale string
    16  
    17  	BeforeEach(func() {
    18  		oldLocale = os.Getenv("LANG")
    19  	})
    20  
    21  	AfterEach(func() {
    22  		os.Setenv("LANG", oldLocale)
    23  	})
    24  
    25  	It("exits 0 when help is run for each language", func() {
    26  		for _, locale := range i18n.SUPPORTED_LOCALES {
    27  			os.Setenv("LANG", locale)
    28  			result := Cf("help")
    29  
    30  			Eventually(result, 5*time.Second).Should(Exit(0))
    31  		}
    32  	})
    33  })