Sha256: 446847f65ad7b9801b6e47560a32550990420c156c5a937aa51c305da069f7cf
Contents?: true
Size: 672 Bytes
Versions: 13
Compression:
Stored size: 672 Bytes
Contents
module RspecRedisHelper RSpec.configure do |config| config.include RSpec::RedisHelper, redis: true # define custom method that flushdb instead of flushall def with_clean_redis_db(&block) redis.client.disconnect redis2.client.disconnect redis.flushdb begin yield ensure redis.flushdb redis.quit redis2.quit end end # clean the redis-helper gem's Redis database around each run config.around(:each, redis: true) do |example| $redis = redis with_clean_redis_db do # force the app to use the redis helper gem's Redis database example.run end end end end
Version data entries
13 entries across 13 versions & 1 rubygems