1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/spec_helpers/redis.rb
Victor Shcherbakov 8e8c6baeaf Update Redis support
Fix #480
2017-07-11 17:41:02 +05:30

15 lines
419 B
Ruby

# encoding: utf-8
begin
require 'redis-objects'
puts "redis-objects gem found, running Redis specs \e[32m#{'✔'}\e[0m"
Redis.current = Redis.new(host: '127.0.0.1', port: 6379)
RSpec.configure do |c|
c.before(:each) do
Redis.current.keys('redis_*').each { |k| Redis.current.del k }
end
end
rescue LoadError
puts "redis-objects gem not found, not running Redis specs \e[31m#{'✖'}\e[0m"
end