summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-20 14:41:54 -0800
committerGitHub <noreply@github.com>2018-11-20 14:41:54 -0800
commit088088f5be6d400b3a506a51af8f256dad3eaf50 (patch)
tree409e187c74170884adcc96a01d3f2eb1f7e020de
parentb9336dc8df02c08408b2b037e4eb62e531355aec (diff)
parent21855e7057e38babad54bd7e978cbd328f457ddd (diff)
downloadchef-088088f5be6d400b3a506a51af8f256dad3eaf50.tar.gz
Merge pull request #7968 from chef/cert_testing
Chef 14: windows_certificate: Add testing of the defaults and allowed properties
-rw-r--r--spec/unit/resource/windows_certificate.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/unit/resource/windows_certificate.rb b/spec/unit/resource/windows_certificate.rb
index 4a60be6e87..97e404a2d5 100644
--- a/spec/unit/resource/windows_certificate.rb
+++ b/spec/unit/resource/windows_certificate.rb
@@ -28,6 +28,36 @@ describe Chef::Resource::WindowsCertificate do
expect(resource.source).to eql("foobar")
end
+ it "the store_name property defaults to 'MY'" do
+ expect(resource.store_name).to eql("MY")
+ end
+
+ it 'the store_name property accepts "TRUSTEDPUBLISHER", "TrustedPublisher", "CLIENTAUTHISSUER", "REMOTE DESKTOP", "ROOT", "TRUSTEDDEVICES", "WEBHOSTING", "CA", "AUTHROOT", "TRUSTEDPEOPLE", "MY", "SMARTCARDROOT", "TRUST", or "DISALLOWED"' do
+ expect { resource.store_name("TRUSTEDPUBLISHER") }.not_to raise_error
+ expect { resource.store_name("TrustedPublisher") }.not_to raise_error
+ expect { resource.store_name("CLIENTAUTHISSUER") }.not_to raise_error
+ expect { resource.store_name("REMOTE DESKTOP") }.not_to raise_error
+ expect { resource.store_name("ROOT") }.not_to raise_error
+ expect { resource.store_name("TRUSTEDDEVICES") }.not_to raise_error
+ expect { resource.store_name("WEBHOSTING") }.not_to raise_error
+ expect { resource.store_name("CA") }.not_to raise_error
+ expect { resource.store_name("AUTHROOT") }.not_to raise_error
+ expect { resource.store_name("TRUSTEDPEOPLE") }.not_to raise_error
+ expect { resource.store_name("MY") }.not_to raise_error
+ expect { resource.store_name("SMARTCARDROOT") }.not_to raise_error
+ expect { resource.store_name("TRUST") }.not_to raise_error
+ expect { resource.store_name("DISALLOWED") }.not_to raise_error
+ end
+
+ it "the resource is marked sensitive if pfx_password is specified" do
+ resource.pfx_password("1234")
+ expect(resource.sensitive).to be true
+ end
+
+ it "the user_store property defaults to false" do
+ expect(resource.user_store).to be false
+ end
+
it "sets the default action as :create" do
expect(resource.action).to eql([:create])
end