Sha256: 68d1a379c9baab6f31d50f1123aa1b6518954e7e7a081e0482c5e25211e6537e

Contents?: true

Size: 920 Bytes

Versions: 5

Compression:

Stored size: 920 Bytes

Contents

dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift dir + '/../lib'
$TESTING = true

require 'test/unit'
require 'resque'
require 'turn'

require 'resque-lock-timeout'
require dir + '/test_jobs'

##
# make sure we can run redis
if !system("which redis-server")
  puts '', "** can't find `redis-server` in your path"
  puts "** try running `sudo rake install`"
  abort ''
end

##
# start our own redis when the tests start,
# kill it when they end
at_exit do
  next if $!

  if defined?(MiniTest)
    exit_code = MiniTest::Unit.new.run(ARGV)
  else
    exit_code = Test::Unit::AutoRunner.run
  end

  pid = `ps -e -o pid,command | grep [r]edis-test`.split(" ")[0]
  puts "Killing test redis server..."
  `rm -f #{dir}/dump.rdb`
  Process.kill("KILL", pid.to_i)
  exit exit_code
end

puts "Starting redis for testing at localhost:9736..."
`redis-server #{dir}/redis-test.conf`
Resque.redis = '127.0.0.1:9736'

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
resque-lock-timeout-0.3.1 test/test_helper.rb
resque-lock-timeout-0.3.0 test/test_helper.rb
resque-lock-timeout-process-aware-0.1.1 test/test_helper.rb
resque-lock-timeout-0.2.1 test/test_helper.rb
resque-lock-timeout-0.2.0 test/test_helper.rb