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

Configurable redis url in tests

This allows for a custom redis url (i.e. when having redis run on a non-default port) in tests. To use this, run the tests with `REDIS_URL=redis://localhost:16379/15 rake`
This commit is contained in:
Dennis Reimann 2013-05-02 09:47:56 +02:00
parent 917cc33b77
commit 5a0a677ba9

View file

@ -25,4 +25,9 @@ require 'sidekiq/util'
Sidekiq.logger.level = Logger::ERROR
require 'sidekiq/redis_connection'
REDIS = Sidekiq::RedisConnection.create(:url => "redis://localhost/15", :namespace => 'testy')
redis_url = ENV['REDIS_URL'] || 'redis://localhost/15'
REDIS = Sidekiq::RedisConnection.create(:url => redis_url, :namespace => 'testy')
Sidekiq.configure_client do |config|
config.redis = { :url => redis_url, :namespace => 'testy' }
end