diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2015-02-27 17:53:41 +0900 |
---|---|---|
committer | sawanoboly <sawanoboriyu@higanworks.com> | 2015-02-27 17:53:41 +0900 |
commit | 7949a6ee09dac336aea0665b76dcfa8b4cb37f32 (patch) | |
tree | a5ce8fd45695bca40c5b001a254e9a233485b0da /spec | |
parent | c4afc649b0da00d585cbf8ff4025a374d68b7802 (diff) | |
download | chef-7949a6ee09dac336aea0665b76dcfa8b4cb37f32.tar.gz |
write spec for case of validation_key is nil.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/bootstrap_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index 5a2e1f1c96..bc054b386a 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -593,6 +593,20 @@ describe Chef::Knife::Bootstrap do knife.run end end + + context "when the validation_key is nil" do + before do + # this tests runs the old code path where we have a validation key, so we need to pass that check for some plugins + Chef::Config[:validation_key] = nil + end + + it "creates the client (and possibly adds chef-vault items)" do + expect(knife_ssh).to receive(:run) + expect(knife.client_builder).not_to receive(:run) + expect(knife.chef_vault_handler).not_to receive(:run).with(node_name: knife.config[:chef_node_name]) + knife.run + end + end end describe "specifying ssl verification" do |