Sha256: ab49f53804eebcad63248b7ec172ab21aa869728400bbb125a9e55843aa2e4c7
Contents?: true
Size: 664 Bytes
Versions: 1
Compression:
Stored size: 664 Bytes
Contents
require 'resque_spec' module ResqueSpec def scheduled?(klass, time, *args) schedule_for(klass).any? {|entry| entry[:klass].to_s == klass.to_s && entry[:time] == time && entry[:args] == args} end def scheduled_anytime?(klass, *args) schedule_for(klass).any? {|entry| entry[:klass].to_s == klass.to_s && entry[:args] == args} end def schedule_for(klass) name = "#{queue_name(klass)}_scheduled" queues[name] end module ResqueScheduler def enqueue_at(time, klass, *args) ResqueSpec.schedule_for(klass) << {:klass => klass.to_s, :time => time, :args => args} end end end Resque.extend(ResqueSpec::ResqueScheduler)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
resque_spec-0.5.0 | lib/resque_spec/resque_scheduler_spec.rb |