diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-25 13:34:01 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-11-25 13:34:01 -0800 |
commit | 3558cccb16ff48be806c3af093462c95d4cc9b04 (patch) | |
tree | f9640cc5997df15f4915c3a7bbf95ef5bcd7bee8 | |
parent | 2dcf8244fd6ad46930112f593e78e0b18851dab6 (diff) | |
download | chef-3558cccb16ff48be806c3af093462c95d4cc9b04.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.rb | 2 | ||||
-rw-r--r-- | spec/unit/config_spec.rb | 4 |
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 58fb229c96..ed2003e8bf 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 |