Sha256: e504cbbed2b4beb1d6cef33443c571172d0fd67ee200a17c547f0f64bd81787a

Contents?: true

Size: 1.14 KB

Versions: 14

Compression:

Stored size: 1.14 KB

Contents

# Pretty much copied this file from the resque test_helper since we want
# to do all the same stuff

dir = File.dirname(File.expand_path(__FILE__))

require 'rubygems'
require 'test/unit'
require 'mocha'
require 'resque'
require File.join(dir, '../lib/resque_scheduler')
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'


#
# 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 = 'localhost:9736'



class SomeJob
  def self.perform(repo_id, path)
  end
end

class SomeIvarJob < SomeJob
  @queue = :ivar
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
thehenster-resque-scheduler-1.0.12 test/test_helper.rb
thehenster-resque-scheduler-1.0.11 test/test_helper.rb
resque-scheduler-1.0.6 test/test_helper.rb
thehenster-resque-scheduler-1.0.10 test/test_helper.rb
thehenster-resque-scheduler-1.0.9 test/test_helper.rb
thehenster-resque-scheduler-1.0.8 test/test_helper.rb
thehenster-resque-scheduler-1.0.7 test/test_helper.rb
thehenster-resque-scheduler-1.0.6 test/test_helper.rb
resque-scheduler-1.0.5 test/test_helper.rb
resque-scheduler-1.0.4 test/test_helper.rb
resque-scheduler-1.0.3 test/test_helper.rb
resque-scheduler-1.0.2 test/test_helper.rb
resque-scheduler-1.0.1 test/test_helper.rb
resque-scheduler-1.0.0 test/test_helper.rb