diff options
author | antima-gupta <agupta@msystechnologies.com> | 2020-05-13 13:55:37 +0530 |
---|---|---|
committer | antima-gupta <agupta@msystechnologies.com> | 2020-06-10 10:51:40 +0530 |
commit | 22d38547a8db55c1a579c1e939253ad526a158cd (patch) | |
tree | e7e0c8947c14132a2d19ca2fd7e1137cb1ac36f1 | |
parent | d119c901aa3aa79d91f9ade440066e85b0d8867d (diff) | |
download | chef-22d38547a8db55c1a579c1e939253ad526a158cd.tar.gz |
removed cron helper files
Signed-off-by: antima-gupta <agupta@msystechnologies.com>
-rw-r--r-- | lib/chef/resource/helpers/cron.rb | 21 | ||||
-rw-r--r-- | spec/unit/resource/helpers/cron_spec.rb | 31 |
2 files changed, 0 insertions, 52 deletions
diff --git a/lib/chef/resource/helpers/cron.rb b/lib/chef/resource/helpers/cron.rb deleted file mode 100644 index 78c3e09b38..0000000000 --- a/lib/chef/resource/helpers/cron.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Chef - module ResourceHelpers - module Cron - - WEEKDAYS = { - sunday: "0", monday: "1", tuesday: "2", wednesday: "3", thursday: "4", friday: "5", saturday: "6", - sun: "0", mon: "1", tue: "2", wed: "3", thu: "4", fri: "5", sat: "6" - }.freeze - - # Convert weekday input value into crontab format that - # could be written in the crontab - # @return [Integer, String] A weekday formed as per the user inputs. - def weekday_in_crontab(wday) - weekday = wday.to_s.downcase.to_sym - weekday_in_crontab = WEEKDAYS[weekday] || wday - end - - extend self - end - end -end diff --git a/spec/unit/resource/helpers/cron_spec.rb b/spec/unit/resource/helpers/cron_spec.rb deleted file mode 100644 index f1e3457a2c..0000000000 --- a/spec/unit/resource/helpers/cron_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require "spec_helper" -require "chef/resource/helpers/cron" - -describe Chef::ResourceHelpers::Cron do - - describe "#weekday_in_crontab" do - context "when weekday is symbol with full name as a day of week" do - it "should return weekday in crontab standard format" do - expect(Chef::ResourceHelpers::Cron.weekday_in_crontab(:wednesday)).to eq("3") - end - end - - context "when weekday is a number in a string" do - it "should return the string" do - expect(Chef::ResourceHelpers::Cron.weekday_in_crontab("3")).to eq("3") - end - end - - context "when weekday is string with the short name as a day of week" do - it "should return the number string in crontab standard format" do - expect(Chef::ResourceHelpers::Cron.weekday_in_crontab("mon")).to eq("1") - end - end - - context "when weekday is an integer" do - it "should return the integer" do - expect(Chef::ResourceHelpers::Cron.weekday_in_crontab(1)).to eq(1) - end - end - end -end |