Sha256: e42e17a455372a1156f9af126fe4c2cf54e0dab5a673c2e78d3152d758107d8d

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

shared_examples 'redis' do
  it_behaves_like 'compatibility'
  it_behaves_like 'hashes'
  it_behaves_like 'connection'
  it_behaves_like 'keys'
  it_behaves_like 'lists'
  it_behaves_like 'server'
  it_behaves_like 'sets'
  it_behaves_like 'strings'
  it_behaves_like 'transactions'
  it_behaves_like 'sorted sets'
  it_behaves_like 'upcase method names'
end

describe 'Rediska' do
  subject { Redis.new }

  before do
    Rediska.configure do |config|
      config.namespace = 'rediska_test'
    end
  end

  context 'fake redis' do
    context 'memory' do
      before do
        subject.flushall
      end

      it_behaves_like 'redis'
    end

    context 'PStore' do
      before do
        Rediska.configure do |config|
          config.database = :filesystem
        end

        subject.flushall
      end

      it_behaves_like 'redis'
    end
  end

  # Remove the pending declaration in order to test interoperability with a local instance of redis.
  pending 'real redis (interoperability)' do
    before do
      subject.flushall
    end

    before(:all) do
      Redis::Connection.drivers.pop
    end

    after(:all) do
      Redis::Connection.drivers << Rediska::Connection
    end

    it_behaves_like 'redis'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rediska-0.0.6 spec/redis_spec.rb
rediska-0.0.5 spec/redis_spec.rb
rediska-0.0.4 spec/redis_spec.rb
rediska-0.0.3 spec/redis_spec.rb
rediska-0.0.2 spec/redis_spec.rb