Sha256: ed16e62d60281d1296bae4dc2f761c99018179fae617f2297509ed795dfdadd2

Contents?: true

Size: 700 Bytes

Versions: 7

Compression:

Stored size: 700 Bytes

Contents

require 'flipper/adapters/redis'

RSpec.describe Flipper::Adapters::Redis do
  let(:client) do
    options = {}

    options[:url] = ENV['REDIS_URL'] if ENV['REDIS_URL']

    Redis.raise_deprecations = true
    Redis.new(options)
  end

  subject { described_class.new(client) }

  before do
    begin
      client.flushdb
    rescue Redis::CannotConnectError
      ENV['CI'] ? raise : skip('Redis not available')
    end
  end

  it_should_behave_like 'a flipper adapter'

  it 'configures itself on load' do
    Flipper.configuration = nil
    Flipper.instance = nil

    silence { load 'flipper/adapters/redis.rb' }

    expect(Flipper.adapter.adapter).to be_a(Flipper::Adapters::Redis)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flipper-redis-0.26.2 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.26.0 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.26.0.rc2 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.26.0.rc1 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.25.4 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.25.3 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.25.2 spec/flipper/adapters/redis_spec.rb