From 7a6df304226d55d73dcc0c8b5082e39811e100b9 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Thu, 26 Mar 2015 20:45:29 -0700 Subject: Add spec for #3153 regression --- spec/unit/util/path_helper_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit v1.2.1