2 $LOAD_PATH.unshift File
.dirname(__FILE__
) + '/../../rspec/lib' # For svn
3 $LOAD_PATH.unshift File
.dirname(__FILE__
) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
9 # This is based on Florian Weber's TDDMate
14 def run(args
, stderr, stdout)
18 ::Dispatcher.reset_application
!
19 ::Dependencies.mechanism
= :load
20 require_dependency('application.rb') unless Object
.const_defined
?(:ApplicationController)
21 load File
.dirname(__FILE__
) + '/../spec/spec_helper.rb'
23 ::Spec::Runner::CommandLine.run(args
, stderr, stdout, false, true)
28 puts
"Loading Rails environment"
30 ENV["RAILS_ENV"] = "test"
31 require File
.expand_path(File
.dirname(__FILE__
) + "/../config/environment")
34 def restart_test_server
36 config
= ::Config::CONFIG
37 ruby
= File
::join(config
['bindir'], config
['ruby_install_name']) + config
['EXEEXT']
38 command_line
= [ruby
, $0, ARGV].flatten
.join(' ')
42 trap("USR2") { restart_test_server
} if Signal
.list
.has_key
?("USR2")
44 DRb
.start_service("druby://localhost:8989", Spec
::Runner::RailsSpecServer.new
)