Sha256: b389e431789a656e639fc60fc7b6c387198774c2bc82354632b588b307173f3a

Contents?: true

Size: 704 Bytes

Versions: 1

Compression:

Stored size: 704 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-redis.rb'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flipper-redis-0.21.0.rc1 spec/flipper/adapters/redis_spec.rb