Skip to content

Commit

Permalink
update unit tests to cover expanded raw cron syntax
Browse files Browse the repository at this point in the history
Also altered one unit test, because :yearly now
outputs @Yearly instead of the equivalent @annually
to simplify the code.
  • Loading branch information
felixbuenemann committed Dec 22, 2011
1 parent a1aa561 commit 81dde20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/unit/cron_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class CronTest < Test::Unit::TestCase
should "parse a :symbol into the correct shortcut" do
assert_equal '@reboot', parse_time(:reboot)
assert_equal '@annually', parse_time(:annually)
assert_equal '@annually', parse_time(:yearly)
assert_equal '@yearly', parse_time(:yearly)
assert_equal '@daily', parse_time(:daily)
assert_equal '@midnight', parse_time(:midnight)
assert_equal '@monthly', parse_time(:monthly)
Expand Down Expand Up @@ -217,7 +217,9 @@ class CronTest < Test::Unit::TestCase

context "When given raw cron sytax" do
should "return the same cron sytax" do
crons = ['0 0 27-31 * *', '* * * * *', '2/3 1,9,22 11-26 1-6 *']
crons = ['0 0 27-31 * *', '* * * * *', '2/3 1,9,22 11-26 1-6 *',
'@reboot', '@yearly', '@annually', '@monthly', '@weekly',
'@daily', '@midnight', '@hourly']
crons.each do |cron|
assert_equal cron, parse_time(cron)
end
Expand Down

0 comments on commit 81dde20

Please sign in to comment.