summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-26 20:45:29 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-26 20:45:29 -0700
commit7a6df304226d55d73dcc0c8b5082e39811e100b9 (patch)
treeace805636a694e6ed31b494d187d05db0f7f1e12
parent9b8f47c7c8118c6ce6514f2e1073b2e50b37b117 (diff)
downloadchef-jdm/3153.tar.gz
Add spec for #3153 regressionjdm/3153
-rw-r--r--spec/unit/util/path_helper_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/util/path_helper_spec.rb b/spec/unit/util/path_helper_spec.rb
index 5756c29b90..23db9587a6 100644
--- a/spec/unit/util/path_helper_spec.rb
+++ b/spec/unit/util/path_helper_spec.rb
@@ -230,4 +230,26 @@ describe Chef::Util::PathHelper do
end
end
end
+
+ describe "all_homes" do
+ before do
+ stub_const('ENV', env)
+ allow(Chef::Platform).to receive(:windows?).and_return(is_windows)
+ end
+
+ context "on windows" do
+ let (:is_windows) { true }
+ end
+
+ context "on unix" do
+ let (:is_windows) { false }
+
+ context "when HOME is not set" do
+ let (:env) { {} }
+ it "returns an empty array" do
+ expect(PathHelper.all_homes).to eq([])
+ end
+ end
+ end
+ end
end