def redis
      ::RSpec.configure do |config|
        config.add_setting :redis
        config.redis = Rails.redis if defined?(Rails.redis)
        config.add_setting :flush_redis_proc
        config.flush_redis_proc = ->(*) { Array.wrap(config.redis).each(&:flushdb) }
        config.before(flush_redis: true) { instance_exec(&config.flush_redis_proc) }
        config.after(:suite) { instance_exec(&config.flush_redis_proc) }
      end
    end
def redis
      ::RSpec.configure do |config|
        config.add_setting :redis
        config.redis = Rails.redis if defined?(Rails.redis)
        config.add_setting :flush_redis_proc
        config.flush_redis_proc = ->(*) { Array.wrap(config.redis).each(&:flushdb) }
        config.before(flush_redis: true) { instance_exec(&config.flush_redis_proc) }
        config.after(:suite) { instance_exec(&config.flush_redis_proc) }
      end
    end
Setups redis to flush db after suite and before each example with
 `flush_redis: :true`. `Rails.redis` client is used by default.
 Can be tuned with `config.redis`.