From 774eefa8aecff313ae809f62b625bbedf41c07af Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 1 Aug 2016 04:21:08 +0100 Subject: [PATCH] test_utils: add with_custom_locale test --- Library/Homebrew/test/test_utils.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Library/Homebrew/test/test_utils.rb b/Library/Homebrew/test/test_utils.rb index 559e60c949..9b55965b54 100644 --- a/Library/Homebrew/test/test_utils.rb +++ b/Library/Homebrew/test/test_utils.rb @@ -78,6 +78,14 @@ class UtilTests < Homebrew::TestCase end end + def test_with_custom_locale + ENV["LC_ALL"] = "en_US.UTF-8" + with_custom_locale("C") do + assert_equal "C", ENV["LC_ALL"] + end + assert_equal "en_US.UTF-8", ENV["LC_ALL"] + end + def test_run_as_not_developer ENV["HOMEBREW_DEVELOPER"] = "foo" run_as_not_developer do