summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-01-21 16:10:03 +0000
committerGitHub <noreply@github.com>2018-01-21 16:10:03 +0000
commit74432a4f3e4de34c3222d3a005c7821c39586f83 (patch)
tree42160a47010722ebd9776eb7d8c60a7113d4616a /spec/support
parent2fef9c4839205903acb8983a8487625a07e351b1 (diff)
parent6a0217296c45b17c6c36f31a77a26d171b5f71e2 (diff)
downloadchef-74432a4f3e4de34c3222d3a005c7821c39586f83.tar.gz
Merge pull request #6758 from chef/tm/creds_int_tests
Ensure we don't use credentials during integration tests
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared/integration/knife_support.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb
index d873723784..86764cad66 100644
--- a/spec/support/shared/integration/knife_support.rb
+++ b/spec/support/shared/integration/knife_support.rb
@@ -83,6 +83,11 @@ module KnifeSupport
# running test scenarios against a real chef server. If things don't
# smell right, abort.
+ # To ensure that we don't pick up a user's credentials file we lie through our teeth about
+ # it's existence.
+ allow(File).to receive(:file?).and_call_original
+ allow(File).to receive(:file?).with(File.expand_path("~/.chef/credentials")).and_return(false)
+
$__KNIFE_INTEGRATION_FAILSAFE_CHECK = "ole"
instance.configure_chef