Sha256: 3ce2d85eb285f51e036ac1e33bce0a81146fd5a70aeb1a064035aa424f59c0c3

Contents?: true

Size: 395 Bytes

Versions: 2

Compression:

Stored size: 395 Bytes

Contents

require 'redis'
require 'redis/connection/memory'

module FakeRedis
  Redis = ::Redis

  def self.enable
    Redis::Connection.drivers << Redis::Connection::Memory unless enabled?
  end

  def self.enabled?
    Redis::Connection.drivers.last == Redis::Connection::Memory
  end

  def self.disable
    Redis::Connection.drivers.delete_if {|driver| Redis::Connection::Memory == driver }
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
fakeredis-0.7.0 lib/fakeredis.rb
kuende-fakeredis-0.10.0 lib/fakeredis.rb