lib/resque_spec/scheduler.rb in resque_spec-0.6.5 vs lib/resque_spec/scheduler.rb in resque_spec-0.6.6

- old
+ new

@@ -3,13 +3,21 @@ module ResqueSpec module SchedulerExt def enqueue_at(time, klass, *args) ResqueSpec.enqueue_at(time, klass, *args) end + + def enqueue_in(time, klass, *args) + ResqueSpec.enqueue_in(time, klass, *args) + end end def enqueue_at(time, klass, *args) store(schedule_queue_name(klass), klass, { :class => klass.to_s, :time => time, :args => args }) + end + + def enqueue_in(time, klass, *args) + enqueue_at(Time.now + time, klass, *args) end def schedule_for(klass) queues[schedule_queue_name(klass)] end