summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-23 14:02:03 -0700
committerTim Smith <tsmith84@gmail.com>2020-03-23 14:02:03 -0700
commit77a4e649f337cc10ea26866636b77c683ba84f42 (patch)
tree1f363e046efba1b1703177a014d7a6ea630d80d8 /spec/unit
parent9053919cd2936468013cb7862e26943210b82aad (diff)
downloadchef-77a4e649f337cc10ea26866636b77c683ba84f42.tar.gz
Add additional specs to the cron_d resource
Why not Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/resource/cron_d_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/resource/cron_d_spec.rb b/spec/unit/resource/cron_d_spec.rb
index 7b1cf3d5ba..93026422a4 100644
--- a/spec/unit/resource/cron_d_spec.rb
+++ b/spec/unit/resource/cron_d_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright 2018, Chef Software, Inc.
+# Copyright:: Copyright 2018-2020, Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,4 +33,16 @@ describe Chef::Resource::CronD do
it "the cron_name property is the name_property" do
expect(resource.cron_name).to eql("cronify")
end
+
+ it "the mode property defaults to '0600'" do
+ expect(resource.mode).to eql("0600")
+ end
+
+ it "the user property defaults to 'root'" do
+ expect(resource.user).to eql("root")
+ end
+
+ it "the command property is required" do
+ expect { resource.command nil }.to raise_error(Chef::Exceptions::ValidationFailed)
+ end
end