summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRyota Arai <ryota.arai@gmail.com>2013-12-04 09:26:22 +0900
committerBryan McLellan <btm@getchef.com>2014-03-20 13:06:29 -0700
commit2fa66bd039aaed21829df80885d647df29f576e3 (patch)
treeca3f232d51a0d26f2af67f8a60031929ce441872 /spec
parenta167025861a1f06308650a3321a8be8be9f715cd (diff)
downloadchef-2fa66bd039aaed21829df80885d647df29f576e3.tar.gz
Cron resource accepts a symbol as `weekday`
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/cron_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/provider/cron_spec.rb b/spec/unit/provider/cron_spec.rb
index 3a7a96c549..181ab23d7e 100644
--- a/spec/unit/provider/cron_spec.rb
+++ b/spec/unit/provider/cron_spec.rb
@@ -833,4 +833,23 @@ MAILTO=foo@example.com
end
end
+
+ describe "weekday_in_crontab" do
+ context "when weekday is symbol" do
+ before do
+ @new_resource.weekday :wednesday
+ end
+ it "should return weekday in crontab format" do
+ @provider.send(:weekday_in_crontab).should eq("3")
+ end
+ end
+ context "when weekday is string" do
+ before do
+ @new_resource.weekday "3"
+ end
+ it "should return the string" do
+ @provider.send(:weekday_in_crontab).should eq("3")
+ end
+ end
+ end
end