summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-01-19 17:05:16 +0000
committerThom May <thom@chef.io>2018-01-19 17:05:16 +0000
commit6a0217296c45b17c6c36f31a77a26d171b5f71e2 (patch)
tree70530d0ce9232d0b00057cba50c7cf7e10afae2e
parent3b6800b84eeb7bd8f84a748ac6734104fdac04b4 (diff)
downloadchef-tm/creds_int_tests.tar.gz
Ensure we don't use credentials during integration teststm/creds_int_tests
Signed-off-by: Thom May <thom@chef.io>
-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