summaryrefslogtreecommitdiff
path: root/spec/unit/config_spec.rb
diff options
context:
space:
mode:
authorKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-03-16 16:06:00 -0400
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-03-20 11:22:30 -0400
commitd2dd332132fef834a55b7ad21eba6b2312cc5a27 (patch)
tree07ed62f2501980f5dbf841f662f2c2f48633178e /spec/unit/config_spec.rb
parent8adb5e38a31f47d84fcac6c825b5bd9279ba6aac (diff)
downloadchef-d2dd332132fef834a55b7ad21eba6b2312cc5a27.tar.gz
Fixup all specs to reference PathHelper.home.
Diffstat (limited to 'spec/unit/config_spec.rb')
-rw-r--r--spec/unit/config_spec.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 06178f7733..6ea67246b5 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -360,18 +360,12 @@ describe Chef::Config do
describe "Chef::Config[:user_home]" do
it "should set when HOME is provided" do
expected = to_platform("/home/kitten")
- allow(Chef::Config).to receive(:env).and_return({ 'HOME' => expected })
- expect(Chef::Config[:user_home]).to eq(expected)
- end
-
- it "should be set when only USERPROFILE is provided" do
- expected = to_platform("/users/kitten")
- allow(Chef::Config).to receive(:env).and_return({ 'USERPROFILE' => expected })
+ allow(Chef::Util::PathHelper).to receive(:home).and_return(expected)
expect(Chef::Config[:user_home]).to eq(expected)
end
it "falls back to the current working directory when HOME and USERPROFILE is not set" do
- allow(Chef::Config).to receive(:env).and_return({})
+ allow(Chef::Util::PathHelper).to receive(:home).and_return(nil)
expect(Chef::Config[:user_home]).to eq(Dir.pwd)
end
end