diff options
Diffstat (limited to 'spec/unit/util/path_helper_spec.rb')
| -rw-r--r-- | spec/unit/util/path_helper_spec.rb | 22 |
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 |
