summaryrefslogtreecommitdiff
path: root/spec/unit/resource
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-11 22:03:00 -0800
committerTim Smith <tsmith@chef.io>2018-11-14 15:02:11 -0800
commit1885a2f08ea34a542a730f143ef6e226653e1e2b (patch)
tree30f93f00cafae692faea845a6a626cff7351e364 /spec/unit/resource
parentc7cdc49cabcdafb59c5f9518e93d0f2f9595c3be (diff)
downloadchef-1885a2f08ea34a542a730f143ef6e226653e1e2b.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>
Diffstat (limited to 'spec/unit/resource')
-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