summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-07-24 17:50:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-07-24 17:50:39 -0700
commit664902730ece4ee028e20d75a01c5b20102f88ee (patch)
tree6f60d7c295e98adf083db83fa96301de72251271
parent44190c60d47fe3d5987cac67c6cc0243231f5310 (diff)
downloadchef-664902730ece4ee028e20d75a01c5b20102f88ee.tar.gz
add a more useful test.
this requires that 'ls' be installed on our test nodes. which it should. the fact that i feel i have to write this means docker is the root of all evil in the universe. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/mixin/which.rb8
1 files changed, 8 insertions, 0 deletions
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