diff options
author | Tim Smith <tsmith@chef.io> | 2018-06-11 12:11:01 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-06-11 12:11:01 -0700 |
commit | ed5bee8a01126054b1fbee91ef39740e0832d55b (patch) | |
tree | 3f7c6146371f7b82085652b8418ad5e1bd4bab26 | |
parent | 3a7571cc84a0b88ddc8ddf01e929e11ce8b041eb (diff) | |
download | chef-ed5bee8a01126054b1fbee91ef39740e0832d55b.tar.gz |
Enable preview_resource for ssh_known_hosts_entry
Add a spec that will fail once we bump the chef version to 15
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/ssh_known_hosts_entry.rb | 3 | ||||
-rw-r--r-- | spec/unit/resource/ssh_known_hosts_entry_spec.rb | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb index c3fcd15627..2406377863 100644 --- a/lib/chef/resource/ssh_known_hosts_entry.rb +++ b/lib/chef/resource/ssh_known_hosts_entry.rb @@ -26,7 +26,8 @@ class Chef provides(:ssh_known_hosts_entry) { true } description "Use the ssh_known_hosts_entry resource to append an entry for the specified host in /etc/ssh/ssh_known_hosts or a user's known hosts file if specified." - introduced "15.0" + introduced "14.3" + preview_resource true property :host, String, description: "The host to add to the known hosts file.", diff --git a/spec/unit/resource/ssh_known_hosts_entry_spec.rb b/spec/unit/resource/ssh_known_hosts_entry_spec.rb index 251675dd10..3bae37dfe7 100644 --- a/spec/unit/resource/ssh_known_hosts_entry_spec.rb +++ b/spec/unit/resource/ssh_known_hosts_entry_spec.rb @@ -26,6 +26,11 @@ describe Chef::Resource::SshKnownHostsEntry do end let(:resource) { Chef::Resource::SshKnownHostsEntry.new("example.com", run_context) } + it "is not a preview resource in Chef 15" do + pending("Chef 15") unless Chef::VERSION.start_with?("15") + expect(resource.class.preview_resource).to be_falsey + end + it "sets resource name as :ssh_known_hosts_entry" do expect(resource.resource_name).to eql(:ssh_known_hosts_entry) end |