Module: ResqueSpec::Resque

Defined in:
lib/resque_spec/resque_spec.rb

Instance Method Summary collapse

Instance Method Details

#dequeue(klass, *args) ⇒ Object



33
34
35
36
37
# File 'lib/resque_spec/resque_spec.rb', line 33

def dequeue(klass, *args)
  ResqueSpec.queue_for(klass).delete_if do |job|
    job[:class] == klass.to_s && args.empty? || job[:args] == args
  end
end

#enqueue(klass, *args) ⇒ Object



30
31
32
# File 'lib/resque_spec/resque_spec.rb', line 30

def enqueue(klass, *args)
  ResqueSpec.queue_for(klass) << {:klass => klass, :args => args}
end