Sha256: b3c157fc1682920170e9772ae5f60524490176fc930501066690c7b35cca7bcc
Contents?: true
Size: 858 Bytes
Versions: 2
Compression:
Stored size: 858 Bytes
Contents
require 'rspec' require 'resque-dynamic-queues' # No need to start redis when running in Travis unless ENV['CI'] begin Resque.queues rescue Errno::ECONNREFUSED spec_dir = File.dirname(File.expand_path(__FILE__)) REDIS_CMD = "redis-server #{spec_dir}/redis-test.conf" puts "Starting redis for testing at localhost..." puts `cd #{spec_dir}; #{REDIS_CMD}` # Schedule the redis server for shutdown when tests are all finished. at_exit do puts 'Stopping redis' pid = File.read("#{spec_dir}/redis.pid").to_i rescue nil system ("kill -9 #{pid}") if pid.to_i != 0 File.delete("#{spec_dir}/redis.pid") rescue nil File.delete("#{spec_dir}/redis-server.log") rescue nil File.delete("#{spec_dir}/dump.rdb") rescue nil end end end class SomeJob def self.perform(*args) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
resque-dynamic-queues-0.8.1 | spec/spec_helper.rb |
resque-dynamic-queues-0.8.0 | spec/spec_helper.rb |