Sha256: 358cb5f1e745cd4fd1aa6398ff28931fb230f3927f0cb37d119f1ffdae33a518
Contents?: true
Size: 1.07 KB
Versions: 2
Compression:
Stored size: 1.07 KB
Contents
require 'simplecov' require 'redis' require 'dalli' SimpleCov.start $: << File.join(File.dirname(__FILE__), '..', 'lib') require 'cashier' ENV['RAILS_ENV'] = 'test' require 'dummy/config/environment' require 'rspec/rails' require 'fileutils' RSpec.configure do |config| # ==========================> Redis test configuration REDIS_PID = Rails.root.join 'tmp', 'pids', 'redis.pid' FileUtils.mkdir_p Rails.root.join 'tmp', 'pids' FileUtils.mkdir_p Rails.root.join 'tmp', 'cache' config.before(:suite) do redis_options = { "daemonize" => 'yes', "pidfile" => REDIS_PID, "port" => 6397, "dir" => Rails.root.join('tmp', 'cache'), }.map { |k, v| "#{k} #{v}" }.join('\n') `echo '#{redis_options}' | redis-server -` sleep 0.25 Cashier::Adapters::RedisStore.redis = Redis.new(:host => '127.0.0.1', :port => 6397) end config.before(:each) do Cashier::Adapters::RedisStore.redis.flushdb Rails.cache.clear end config.after :suite do Process.kill "TERM", File.read(REDIS_PID).to_i end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
cashier-ftbpro-0.5.0 | spec/spec_helper.rb |
cashier-0.4.1 | spec/spec_helper.rb |