summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-11 22:03:00 -0800
committerTim Smith <tsmith@chef.io>2018-11-20 14:05:39 -0800
commit21855e7057e38babad54bd7e978cbd328f457ddd (patch)
tree4091970ecb0a2ba1c7170acbc3fbde648d732255
parentabdfa74d7f34114a3584efa6f8aabe337be8d80f (diff)
downloadchef-21855e7057e38babad54bd7e978cbd328f457ddd.tar.gz
windows_certificate: Add testing of the defaults and allowed properties
These should have been tested when I merged this in. It's easy stuff to verify with unit tests. Signed-off-by: Tim Smith <tsmith@chef.io>
-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