summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2020-07-24 18:23:58 -0700
committerGitHub <noreply@github.com>2020-07-24 18:23:58 -0700
commit43da6781cac13acbed55c1761d994fbba05b2487 (patch)
tree6f60d7c295e98adf083db83fa96301de72251271
parent051998e10d4188594ec8ce924c6a02584c60508a (diff)
parent664902730ece4ee028e20d75a01c5b20102f88ee (diff)
downloadchef-43da6781cac13acbed55c1761d994fbba05b2487.tar.gz
Merge pull request #10206 from chef/lcg/fix-el6-selinux
-rw-r--r--lib/chef/mixin/which.rb2
-rw-r--r--spec/unit/mixin/which.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/chef/mixin/which.rb b/lib/chef/mixin/which.rb
index 1e58c8bc3a..9f2ad83702 100644
--- a/lib/chef/mixin/which.rb
+++ b/lib/chef/mixin/which.rb
@@ -31,7 +31,7 @@ class Chef
# we dep-inject default paths into this API for historical reasons
#
# @api private
- def __extra_paths
+ def __extra_path
__default_paths
end
end
diff --git a/spec/unit/mixin/which.rb b/spec/unit/mixin/which.rb
index 00d867b529..60af349a62 100644
--- a/spec/unit/mixin/which.rb
+++ b/spec/unit/mixin/which.rb
@@ -159,4 +159,12 @@ describe Chef::Mixin::Which do
end
end
end
+
+ describe "useful non-stubbed tests" do
+ it "works even when the PATH is nuked via adding default_paths", unix_only: true do
+ old_path = ENV["PATH"]
+ expect(test.which("ls")).to be_truthy
+ ENV["PATH"] = old_path
+ end
+ end
end