lib/resque_spec/scheduler.rb in resque_spec-0.6.8 vs lib/resque_spec/scheduler.rb in resque_spec-0.7.0

- old
+ new

@@ -7,31 +7,31 @@ end def enqueue_in(time, klass, *args) ResqueSpec.enqueue_in(time, klass, *args) end - + def remove_delayed(klass, *args) ResqueSpec.remove_delayed(klass, *args) end end def enqueue_at(time, klass, *args) - store(schedule_queue_name(klass), :class => klass.to_s, :time => time, :args => args) + perform_or_store(schedule_queue_name(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 remove_delayed(klass, *args) queue_by_name(schedule_queue_name(klass)).delete_if do |job| job[:class] == klass.to_s && job[:args] == args end end - + def schedule_for(klass) - queues[schedule_queue_name(klass)] + queue_by_name(schedule_queue_name(klass)) end private def schedule_queue_name(klass)