Skip to content

Commit

Permalink
Support redis-rb v4
Browse files Browse the repository at this point in the history
Also:
 - Stub #connection method on MockRedis instances
  • Loading branch information
snmgian committed Oct 6, 2017
1 parent 57400fc commit c49d678
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sidekiq-scheduler.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.files = Dir['{lib,web}/**/*'] + %w[MIT-LICENSE Rakefile README.md]

s.add_dependency 'sidekiq', '>= 3'
s.add_dependency 'redis', '~> 3'
s.add_dependency 'redis', '>= 3', '< 5'
s.add_dependency 'rufus-scheduler', '~> 3.2'
s.add_dependency 'tilt', '>= 1.4.0'

Expand Down
10 changes: 5 additions & 5 deletions spec/support/initialization/redis.rb
Expand Up @@ -4,13 +4,13 @@
RSpec.configure do |config|
config.before do
redis = MockRedis.new
client = Object.new

client.define_singleton_method(:id) do
"redis://127.0.0.1:1234/0"
end
connection = {
location: '127.0.0.1:1234',
db: '0'
}

allow(redis).to receive(:client).and_return(client)
redis.define_singleton_method(:connection) { connection }

allow(Sidekiq::RedisConnection).to receive(:create).and_return(ConnectionPool.new({}) {
redis
Expand Down

0 comments on commit c49d678

Please sign in to comment.