Sha256: 4ff1160998438ae7d7a9e76fd6079777d552d5940a1fef767fb85742b22110db

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

require 'helper'
require 'flipper/adapters/redis'
require 'flipper/spec/shared_adapter_specs'

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

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

    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

    load 'flipper/adapters/redis.rb'

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flipper-redis-0.22.2 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.22.1 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.22.0 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.21.0 spec/flipper/adapters/redis_spec.rb
flipper-redis-0.21.0.rc2 spec/flipper/adapters/redis_spec.rb