test/scheduler_test.rb in resque-scheduler-2.0.0 vs test/scheduler_test.rb in resque-scheduler-2.0.1

- old
+ new

@@ -2,12 +2,11 @@ context "Resque::Scheduler" do setup do Resque::Scheduler.dynamic = false - Resque.redis.del(:schedules) - Resque.redis.del(:schedules_changed) + Resque.redis.flushall Resque::Scheduler.mute = true Resque::Scheduler.clear_schedule! Resque::Scheduler.send(:class_variable_set, :@@scheduled_jobs, {}) end @@ -70,28 +69,28 @@ assert_equal '/tmp/2', Resque.schedule["some_ivar_job2"]["args"] assert Resque::Scheduler.scheduled_jobs.include?("some_ivar_job2") end - test "load_schedule_job loads a schedule" do + test "load_schedule_job loads a schedule" do Resque::Scheduler.load_schedule_job("some_ivar_job", {'cron' => "* * * * *", 'class' => 'SomeIvarJob', 'args' => "/tmp"}) assert_equal(1, Resque::Scheduler.rufus_scheduler.all_jobs.size) assert_equal(1, Resque::Scheduler.scheduled_jobs.size) assert Resque::Scheduler.scheduled_jobs.keys.include?("some_ivar_job") end - - test "load_schedule_job with every with options" do + + test "load_schedule_job with every with options" do Resque::Scheduler.load_schedule_job("some_ivar_job", {'every' => ['30s', {'first_in' => '60s'}], 'class' => 'SomeIvarJob', 'args' => "/tmp"}) assert_equal(1, Resque::Scheduler.rufus_scheduler.all_jobs.size) assert_equal(1, Resque::Scheduler.scheduled_jobs.size) assert Resque::Scheduler.scheduled_jobs.keys.include?("some_ivar_job") assert Resque::Scheduler.scheduled_jobs["some_ivar_job"].params.keys.include?(:first_in) end - - test "load_schedule_job with cron with options" do + + test "load_schedule_job with cron with options" do Resque::Scheduler.load_schedule_job("some_ivar_job", {'cron' => ['* * * * *', {'allow_overlapping' => 'true'}], 'class' => 'SomeIvarJob', 'args' => "/tmp"}) assert_equal(1, Resque::Scheduler.rufus_scheduler.all_jobs.size) assert_equal(1, Resque::Scheduler.scheduled_jobs.size) assert Resque::Scheduler.scheduled_jobs.keys.include?("some_ivar_job") @@ -241,7 +240,6 @@ assert_nothing_raised do Resque::Plugin.lint(Resque::Scheduler) Resque::Plugin.lint(ResqueScheduler) end end - end