Sha256: 0540b540dbd874615dea5d5aaa8a983598be303625957d634ea922808f4b841e

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'mocha'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'resque/resque'
require 'resque/throttle'
require 'resque/throttled_job'

class Test::Unit::TestCase
end

#fixture classes
class DefaultThrottledJob < Resque::ThrottledJob
  @queue = :some_queue
  
  def self.perform(some_id, some_other_thing)
  end
end

class OneHourThrottledJob < Resque::ThrottledJob
  @queue = :some_queue

  throttle :can_run_every => 3600,
           :enqueued => "Yada Yada",
           :throttled => "Yada Yada",
           :latest => "Yada Yada"


  def self.perform(some_id, some_other_thing)
  end
end

class IdetifierThrottledJob < Resque::ThrottledJob
  @queue = :some_queue

  throttle :identifier => "my_identifier" 

  def self.perform(some_id, some_other_thing)
  end
end

class DisabledThrottledJob < Resque::ThrottledJob
  @queue = :some_queue

  throttle :disabled => true

  def self.perform(some_id, some_other_thing)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
resque-throttle-0.2.4 test/test_helper.rb
resque-throttle-0.2.3 test/test_helper.rb
resque-throttle-0.2.2 test/test_helper.rb
resque-throttle-0.2.1 test/test_helper.rb
resque-throttle-0.2.0 test/test_helper.rb