diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-02 16:47:26 -0300 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-06-02 12:47:26 -0700 |
commit | 159953050a9c4fb700bbde79042ead4843b0bea5 (patch) | |
tree | 747a022c5cf579599402447b5e5d0f51dfee9f76 /vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go | |
parent | e44b8ec6d57fc55230a5c97ea105b7fd9ef59aca (diff) | |
download | chat-159953050a9c4fb700bbde79042ead4843b0bea5.tar.gz chat-159953050a9c4fb700bbde79042ead4843b0bea5.tar.bz2 chat-159953050a9c4fb700bbde79042ead4843b0bea5.zip |
PLT-1800 Load server side locale from the config.json (#3202)
* PLT-1800 Load server side locale from the config.json
* Add support for locales with country specifics
* Fix localization on served locale file as plain/text
* Remove github.com/cloudfoundry/jibber_jabber as vendor dependency
* Fix get locale on login_controller
Diffstat (limited to 'vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go')
-rw-r--r-- | vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go b/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go deleted file mode 100644 index a5e3074a2..000000000 --- a/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go +++ /dev/null @@ -1,104 +0,0 @@ -// +build darwin freebsd linux netbsd openbsd - -package jibber_jabber_test - -import ( - "os" - - . "github.com/cloudfoundry/jibber_jabber" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Unix", func() { - AfterEach(func() { - os.Setenv("LC_ALL", "") - os.Setenv("LANG", "en_US.UTF-8") - }) - - Describe("#DetectIETF", func() { - Context("Returns IETF encoded locale", func() { - It("should return the locale set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectIETF() - Ω(result).Should(Equal("fr-FR")) - }) - - It("should return the locale set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectIETF() - Ω(result).Should(Equal("fr-FR")) - }) - - It("should return an error if it cannot detect a locale", func() { - os.Setenv("LANG", "") - - _, err := DetectIETF() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - - Context("when the locale is simply 'fr'", func() { - BeforeEach(func() { - os.Setenv("LANG", "fr") - }) - - It("should return the locale without a territory", func() { - language, err := DetectIETF() - Ω(err).ShouldNot(HaveOccurred()) - Ω(language).Should(Equal("fr")) - }) - }) - }) - - Describe("#DetectLanguage", func() { - Context("Returns encoded language", func() { - It("should return the language set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectLanguage() - Ω(result).Should(Equal("fr")) - }) - - It("should return the language set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectLanguage() - Ω(result).Should(Equal("fr")) - }) - - It("should return an error if it cannot detect a language", func() { - os.Setenv("LANG", "") - - _, err := DetectLanguage() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - }) - - Describe("#DetectTerritory", func() { - Context("Returns encoded territory", func() { - It("should return the territory set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectTerritory() - Ω(result).Should(Equal("FR")) - }) - - It("should return the territory set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectTerritory() - Ω(result).Should(Equal("FR")) - }) - - It("should return an error if it cannot detect a territory", func() { - os.Setenv("LANG", "") - - _, err := DetectTerritory() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - }) - -}) |