Sha256: 289ab138b853f46bce1e9df6cd850d243c2e8141ad2c5037666262fe6fbd160d

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 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

  def self.perform(some_id, some_other_thing)
  end
end

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

  throttle :can_run_every => 3600

  def self.perform(some_id, some_other_thing)
  end
  
  def self.identifier(*args)
    first, second = *args
    "my_#{first}"
  end
end

class DisabledThrottledJob < Resque::ThrottledJob
  @queue = :some_queue
  throttle :disabled => true

  def self.perform(some_id, some_other_thing)
  end
end

class SilentThrottledJob < Resque::ThrottledJob
  @queue = :some_queue
  throttle :silent => true
  
  def self.perform(some_id, some_other_thing)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fhwang-resque-throttle-0.3.0 test/test_helper.rb