diff options
author | Seth Chisamore <schisamo@opscode.com> | 2013-10-17 10:07:31 -0400 |
---|---|---|
committer | Seth Chisamore <schisamo@opscode.com> | 2013-10-17 10:08:46 -0400 |
commit | bb96406df8b0298f8d854bf065a90b4542952030 (patch) | |
tree | 53233d6b7a097261b31b094703dea49dcc6b52c7 /spec | |
parent | a41dd245e825161fac10242f7f0df886041ba3ed (diff) | |
download | chef-bb96406df8b0298f8d854bf065a90b4542952030.tar.gz |
[CHEF-4509] read `secret` `secret_file` from knife hash
The new config values for specifying a raw secret or path to a secret
file were being incorrectly read from the top-level of the `knife.rb`
config keys. This commit fixes things to correctly read from the knife
hash as documented here:
http://docs.opscode.com/config_rb_knife.html
https://github.com/opscode/chef/blob/11.6.0/lib/chef/knife/bootstrap.rb#L262
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index 808a6f27ad..47261e2068 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -118,14 +118,22 @@ EXPECTED describe "when an encrypted_data_bag_secret is provided" do context "via config[:secret]" do - let(:config){ {:secret => "supersekret" }} + let(:chef_config) do + { + :knife => {:secret => "supersekret" } + } + end it "reads the encrypted_data_bag_secret" do bootstrap_context.encrypted_data_bag_secret.should eq "supersekret" end end context "via config[:secret_file]" do - let(:config){ {:secret_file => secret_file}} + let(:chef_config) do + { + :knife => {:secret_file => secret_file} + } + end it "reads the encrypted_data_bag_secret" do bootstrap_context.encrypted_data_bag_secret.should eq IO.read(secret_file) end |