diff options
author | Ranjib Dey <ranjib@pagerduty.com> | 2013-11-27 11:23:02 +0530 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-12-20 10:06:44 -0800 |
commit | 500665cb061d2b612b0a8804088364d50c806db2 (patch) | |
tree | 9279dd8cce6fa6d9acc84ceda8f29c3af4605e86 /spec/unit/mixin | |
parent | 1ee3cbe6c02748e80d8ef2d9eca2a4609750b2d7 (diff) | |
download | chef-500665cb061d2b612b0a8804088364d50c806db2.tar.gz |
allow chef to be invoked with empty environment (env -i)
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r-- | spec/unit/mixin/path_sanity_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb index e38ee7dc8a..bea2e78ecd 100644 --- a/spec/unit/mixin/path_sanity_spec.rb +++ b/spec/unit/mixin/path_sanity_spec.rb @@ -38,6 +38,12 @@ describe Chef::Mixin::PathSanity do Chef::Platform.stub!(:windows?).and_return(false) end + it "adds all useful PATHs even if environment is an empty hash" do + env={} + @sanity.enforce_path_sanity(env) + env["PATH"].should == "#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + end + it "adds all useful PATHs that are not yet in PATH to PATH" do env = {"PATH" => ""} @sanity.enforce_path_sanity(env) |