1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Minimize annoying warnings

This commit is contained in:
Mike Perham 2012-02-09 22:33:36 -08:00
parent 12d95dde6c
commit 69b00cfe50
3 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,7 @@
module Sidekiq
module Worker
module ClassMethods
alias_method :perform_async_old, :perform_async
def perform_async(*args)
self.new.perform(*args)
end

View file

@ -31,7 +31,6 @@ class TestManager < MiniTest::Unit::TestCase
Sidekiq::Client.push(:foo, 'class' => IntegrationWorker, 'args' => [1, 2])
q = TimedQueue.new
redis = Sidekiq::RedisConnection.create(:url => 'redis://localhost/sidekiq_test')
mgr = Sidekiq::Manager.new(@redis, :queues => [:foo], :processor_count => 2)
mgr.when_done do |_|
q << 'done' if $processed == 2

View file

@ -14,11 +14,15 @@ class TestTesting < MiniTest::Unit::TestCase
it 'calls the worker directly when in testing mode' do
begin
# Override Sidekiq::Worker
load 'sidekiq/testing.rb'
require 'sidekiq/testing'
assert_equal 3, DirectWorker.perform_async(1, 2)
ensure
# Undo override
load 'sidekiq/worker.rb'
Sidekiq::Worker::ClassMethods.class_eval do
remove_method :perform_async
alias_method :perform_async, :perform_async_old
remove_method :perform_async_old
end
end
end