summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-09-03 12:13:34 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-03 12:13:34 -0700
commit440ce47cdc3f124fece96855a37d40c0a303c3cf (patch)
tree3a2476820a603d774d3b7b4a534b808b18057c8a /spec
parent767ea4fc19cb29a55a81a55d1a13643ae3108f4c (diff)
downloadmixlib-shellout-440ce47cdc3f124fece96855a37d40c0a303c3cf.tar.gz
control ENV['LC_ALL'] global better
fixes travis failure that did not fail on my desktop
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 0a1b0a8..f7625e1 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -425,6 +425,14 @@ describe Mixlib::ShellOut do
end
context 'when handling locale' do
+ before do
+ @original_lc_all = ENV['LC_ALL']
+ ENV['LC_ALL'] = "en_US.UTF-8"
+ end
+ after do
+ ENV['LC_ALL'] = @original_lc_all
+ end
+
subject { stripped_stdout }
let(:cmd) { ECHO_LC_ALL }
let(:options) { { :environment => { 'LC_ALL' => locale } } }
@@ -432,7 +440,7 @@ describe Mixlib::ShellOut do
context 'without specifying environment' do
let(:options) { nil }
it "should no longer use the C locale by default" do
- should eql("")
+ should eql("en_US.UTF-8")
end
end
@@ -447,15 +455,6 @@ describe Mixlib::ShellOut do
context 'with LC_ALL set to nil' do
let(:locale) { nil }
- before do
- @original_lc_all = ENV['LC_ALL']
- ENV['LC_ALL'] = "en_US.UTF-8"
- end
-
- after do
- ENV['LC_ALL'] = @original_lc_all
- end
-
context 'when running under Unix', :unix_only do
let(:parent_locale) { ENV['LC_ALL'].to_s.strip }