summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettcave <brett@cave.za.net>2014-06-17 08:49:16 +0200
committerbrettcave <brett@cave.za.net>2014-06-17 08:49:16 +0200
commit655e5511f6c4e77fc4d74249c5100da8f3eacf0b (patch)
tree4eb7dd8e7f3bd4e1f2564482b37066750f005aaa
parent3de901156fddfe33ffa30c73c4d36d9bc288ab6d (diff)
downloadchef-655e5511f6c4e77fc4d74249c5100da8f3eacf0b.tar.gz
CHEF-5365 - added a unit test to ensure fallback of Dir.pwd works without environment variables set
-rw-r--r--spec/unit/config_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index c467d7d553..37527c04c4 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -341,6 +341,11 @@ describe Chef::Config do
Chef::Config.stub(:env).and_return({ 'USERPROFILE' => "/users/kitten" })
Chef::Config[:user_home].should == "/users/kitten"
end
+
+ it "falls back to the current working directory when HOME and USERPROFILE is not set" do
+ Chef::Config.stub(:env).and_return({})
+ Chef::Config[:user_home].should == Dir.pwd
+ end
end
describe "Chef::Config[:encrypted_data_bag_secret]" do