diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test/util/utiltest.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/util/utiltest.rb b/test/util/utiltest.rb index 689bb7629..419d9820e 100755 --- a/test/util/utiltest.rb +++ b/test/util/utiltest.rb @@ -337,6 +337,13 @@ class TestPuppetUtil < Test::Unit::TestCase orig_lc_all = ENV["LC_ALL"] orig_lc_messages = ENV["LC_MESSAGES"] orig_language = ENV["LANGUAGE"] + + cleanup do + ENV["LANG"] = orig_lang + ENV["LC_ALL"] = orig_lc_all + ENV["LC_MESSAGES"] = orig_lc_messages + ENV["LANGUAGE"] = orig_lc_messages + end # Mmm, we love gettext(3) ENV["LANG"] = "en_US" @@ -345,17 +352,13 @@ class TestPuppetUtil < Test::Unit::TestCase ENV["LANGUAGE"] = "en_US" %w{LANG LC_ALL LC_MESSAGES LANGUAGE}.each do |env| - assert_equal 'C', + assert_equal('C', Puppet::Util.execute(['ruby', '-e', "print ENV['#{env}']"]), - "Environment var #{env} wasn't set to 'C'" + "Environment var #{env} wasn't set to 'C'") assert_equal 'en_US', ENV[env], "Environment var #{env} not set back correctly" end - ENV["LANG"] = orig_lang - ENV["LC_ALL"] = orig_lc_all - ENV["LC_MESSAGES"] = orig_lc_messages - ENV["LANGUAGE"] = orig_lc_messages end # Check whether execute() accepts strings in addition to arrays. |
