From 82c0a17dd4ec9212cb5ef5de40cccf157e2c7b54 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Sun, 30 Sep 2018 21:24:44 -0300 Subject: [PATCH] Test against Redis 3.x --- .travis.yml | 1 + Appraisals | 4 ++++ gemfiles/redis_3.gemfile | 9 +++++++++ .../active_support_redis_cache_store_pooled_spec.rb | 2 +- .../stores/active_support_redis_cache_store_spec.rb | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gemfiles/redis_3.gemfile diff --git a/.travis.yml b/.travis.yml index 27f22bb..beaede1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ gemfile: - gemfiles/rails_4_2.gemfile - gemfiles/dalli2.gemfile - gemfiles/redis_4.gemfile + - gemfiles/redis_3.gemfile - gemfiles/connection_pool_dalli.gemfile - gemfiles/active_support_redis_cache_store.gemfile - gemfiles/active_support_redis_cache_store_pooled.gemfile diff --git a/Appraisals b/Appraisals index 1328254..f1f8288 100644 --- a/Appraisals +++ b/Appraisals @@ -44,6 +44,10 @@ appraise 'redis_4' do gem 'redis', '~> 4.0' end +appraise 'redis_3' do + gem 'redis', '~> 3.3' +end + appraise "connection_pool_dalli" do gem "connection_pool", "~> 2.2" gem "dalli", "~> 2.7" diff --git a/gemfiles/redis_3.gemfile b/gemfiles/redis_3.gemfile new file mode 100644 index 0000000..acf4e1a --- /dev/null +++ b/gemfiles/redis_3.gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "redis", "~> 3.3" + +gemspec path: "../" diff --git a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb index 860b765..3bfc2cf 100644 --- a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb +++ b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb @@ -2,7 +2,7 @@ require_relative "../../spec_helper" -if defined?(::ConnectionPool) && defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) +if defined?(::ConnectionPool) && defined?(::Redis) && Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") && defined?(::ActiveSupport::Cache::RedisCacheStore) require_relative "../../support/cache_store_helper" require "timecop" diff --git a/spec/acceptance/stores/active_support_redis_cache_store_spec.rb b/spec/acceptance/stores/active_support_redis_cache_store_spec.rb index c9c4a91..565ac29 100644 --- a/spec/acceptance/stores/active_support_redis_cache_store_spec.rb +++ b/spec/acceptance/stores/active_support_redis_cache_store_spec.rb @@ -2,7 +2,7 @@ require_relative "../../spec_helper" -if defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) +if defined?(::Redis) && Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") && defined?(::ActiveSupport::Cache::RedisCacheStore) require_relative "../../support/cache_store_helper" require "timecop"