diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2017-09-28 21:54:00 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2017-10-08 15:37:54 -0700 |
commit | 53c516d88d48bafee5bd125a368352dd94f5fdad (patch) | |
tree | fcf21f1bd6ef63146964fbb530cc7700d0176e75 /activejob/test/support | |
parent | f165628cdf9a6d857ea6eeca02ed6c950b250df5 (diff) | |
download | rails-53c516d88d48bafee5bd125a368352dd94f5fdad.tar.gz rails-53c516d88d48bafee5bd125a368352dd94f5fdad.tar.bz2 rails-53c516d88d48bafee5bd125a368352dd94f5fdad.zip |
redis-rb 4.0 support
* Use `gem 'redis', '~> 4.0'` for new app Gemfiles
* Loosen Action Cable redis-rb dep to `>= 3.3, < 5`
* Bump redis-namespace for looser Redis version dep
* Avoid using the underlying `redis.client` directly
* Use `Redis.new` instead of `Redis.connect`
Diffstat (limited to 'activejob/test/support')
-rw-r--r-- | activejob/test/support/integration/adapters/resque.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/activejob/test/support/integration/adapters/resque.rb b/activejob/test/support/integration/adapters/resque.rb index 484b476567..7d5174b957 100644 --- a/activejob/test/support/integration/adapters/resque.rb +++ b/activejob/test/support/integration/adapters/resque.rb @@ -3,7 +3,7 @@ module ResqueJobsManager def setup ActiveJob::Base.queue_adapter = :resque - Resque.redis = Redis::Namespace.new "active_jobs_int_test", redis: Redis.connect(url: "redis://:password@127.0.0.1:6379/12", thread_safe: true) + Resque.redis = Redis::Namespace.new "active_jobs_int_test", redis: Redis.new(url: "redis://:password@127.0.0.1:6379/12", thread_safe: true) Resque.logger = Rails.logger unless can_run? puts "Cannot run integration tests for resque. To be able to run integration tests for resque you need to install and start redis.\n" @@ -41,11 +41,8 @@ module ResqueJobsManager end def can_run? - begin - Resque.redis.client.connect - rescue - return false - end - true + Resque.redis.ping == "PONG" + rescue + false end end |