summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-11-25 13:34:01 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-11-25 13:48:05 -0800
commitc7b94588e99f741e742bff9a3d2ea210209bf4f8 (patch)
tree590e31a03eb22243287ebb7bbc5657c372663f19
parent2bd8c073d57f13069b08beea97573358f94d8018 (diff)
downloadchef-c7b94588e99f741e742bff9a3d2ea210209bf4f8.tar.gz
suppress locale -a warnings on windows
need the '!' to throw exceptions, or else the rescue clause is never run.
-rw-r--r--lib/chef/config.rb2
-rw-r--r--spec/unit/config_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 08ce1a8ff6..538271de0e 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -632,7 +632,7 @@ class Chef
#
# For example, on CentOS 6 with ENV['LANG'] = "en_US.UTF-8",
# `locale -a`.split fails with ArgumentError invalid UTF-8 encoding.
- locales = shell_out_with_systems_locale("locale -a").stdout.split
+ locales = shell_out_with_systems_locale!("locale -a").stdout.split
case
when locales.include?('C.UTF-8')
'C.UTF-8'
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 5e4c610bc0..a76a2fac8e 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -426,7 +426,7 @@ describe Chef::Config do
let(:locales) { locale_array.join("\n") }
before do
- allow(Chef::Config).to receive(:shell_out_with_systems_locale).with("locale -a").and_return(shell_out)
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale!).with("locale -a").and_return(shell_out)
end
shared_examples_for "a suitable locale" do
@@ -493,7 +493,7 @@ describe Chef::Config do
let(:locale_array) { [] }
before do
- allow(Chef::Config).to receive(:shell_out_with_systems_locale).and_raise("THIS IS AN ERROR")
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale!).and_raise("THIS IS AN ERROR")
end
it "should default to 'en_US.UTF-8'" do