Sha256: 1300e745323fac24f83b997163219752c7fd0952241eb9befe898c0d0b9b0e4d

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

require 'resque_spec'

module ResqueSpec
  module SchedulerExt
    def enqueue_at(time, klass, *args)
      ResqueSpec.enqueue_at(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 schedule_for(klass)
    queues[schedule_queue_name(klass)]
  end

  private

  def schedule_queue_name(klass)
    "#{queue_name(klass)}_scheduled"
  end
end

Resque.extend(ResqueSpec::SchedulerExt)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
resque_spec-0.6.5 lib/resque_spec/scheduler.rb
resque_spec-0.6.4 lib/resque_spec/scheduler.rb
resque_spec-0.6.3 lib/resque_spec/scheduler.rb