```ruby
# Require this either in your Gemfile or in RSpec's 
# support scripts. Examples: 
#
#   # Gemfile
#   group :test do
#     gem "rspec"
#     gem "fakeredis", :require => "fakeredis/rspec"
#   end 
#
#   # spec/support/fakeredis.rb
#   require 'fakeredis/rspec'
#

require 'rspec/core'
require 'fakeredis'

RSpec.configure do |c|
  
  c.before do    
    redis = Redis.current
    redis.flushdb if redis.client.connection.is_a?(Redis::Connection::Memory)
  end
  
end
```

Reset all instances we know of before each spec
user
```ruby
# Require this either in your Gemfile or in RSpec's
# support scripts. Examples:
#
#   # Gemfile
#   group :test do
#     gem "rspec"
#     gem "fakeredis", :require => "fakeredis/rspec"
#   end
#
#   # spec/support/fakeredis.rb
#   require 'fakeredis/rspec'
#

require 'rspec/core'
require 'fakeredis'

RSpec.configure do |c|

  c.before do    
    Redis::Connection::Memory.instances.values.each &:flushdb
  end

end
```
assistant