Sha256: 87ac41002334c2bbdddcf32c61d2d80cbcdbce33aaa5489ece50893f835406e5

Contents?: true

Size: 995 Bytes

Versions: 3

Compression:

Stored size: 995 Bytes

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 IdetifierThrottledJob < Resque::ThrottledJob
  @queue = :some_queue

  throttle :can_run_every => 3600

  def self.perform(some_id, some_other_thing)
  end
  
  def self.identifier(*args)
    "my_identifier"
  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

3 entries across 3 versions & 1 rubygems

Version Path
resque-throttle-0.2.9 test/test_helper.rb
resque-throttle-0.2.8 test/test_helper.rb
resque-throttle-0.2.7 test/test_helper.rb