diff --git a/Gemfile b/Gemfile index f095a60..fbef39b 100644 --- a/Gemfile +++ b/Gemfile @@ -6,13 +6,13 @@ gemspec # Run all pre-commit hooks via Overcommit during CI runs gem 'overcommit', '0.61.0' +# Pin redis-rb version since v5 introduced breaking changes +gem 'redis', '>= 5.0.0' # Pin tool versions (which are executed by Overcommit) for CI builds gem 'rubocop', '1.44.1' gem 'simplecov', '~> 0.22.0' gem 'simplecov-lcov', '~> 0.8.0' -gem 'redis', '>= 5.0.0' # TODO: gems added for development, remove before merge # gem 'pry' - diff --git a/lib/mock_redis/utility_methods.rb b/lib/mock_redis/utility_methods.rb index 037999b..0a9d439 100644 --- a/lib/mock_redis/utility_methods.rb +++ b/lib/mock_redis/utility_methods.rb @@ -79,7 +79,7 @@ def redis_gem_v5? Redis::VERSION.to_i == 5 end - def size_after(obj, &blk) + def size_after(obj, &_blk) size_before = obj.size yield (obj.size - size_before).abs diff --git a/spec/commands/sadd_spec.rb b/spec/commands/sadd_spec.rb index 2dc4cc3..4819dfb 100644 --- a/spec/commands/sadd_spec.rb +++ b/spec/commands/sadd_spec.rb @@ -4,7 +4,7 @@ before { @key = 'mock-redis-test:sadd' } context 'sadd' do - context "adapts to redis-rd version 4 and 5 outputs" do + context 'adapts to redis-rd version 4 and 5 outputs' do include MockRedis::UtilityMethods let(:positive_response) { redis_gem_v5? ? 1 : true } diff --git a/spec/commands/srem_spec.rb b/spec/commands/srem_spec.rb index 598cebc..51a7f02 100644 --- a/spec/commands/srem_spec.rb +++ b/spec/commands/srem_spec.rb @@ -8,7 +8,7 @@ @redises.sadd(@key, 'ernie') end - context "adapts to redis-rd version 4 and 5 outputs" do + context 'adapts to redis-rd version 4 and 5 outputs' do include MockRedis::UtilityMethods let(:positive_response) { redis_gem_v5? ? 1 : true }