diff options
author | Johan Sørensen <johan@johansorensen.com> | 2007-11-18 00:21:31 +0100 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2007-11-18 00:21:31 +0100 |
commit | 0a7b4ac74b5ee6020894dd20a7267a726f2a2c73 (patch) | |
tree | d06fe166d4f7129b62bd195a933ee3c5398c3909 /script/spec_server | |
parent | 6f6e805eb0e6010a8cf99eb2f67b091b3827d252 (diff) | |
download | gitorious-mainline-outdated-0a7b4ac74b5ee6020894dd20a7267a726f2a2c73.zip gitorious-mainline-outdated-0a7b4ac74b5ee6020894dd20a7267a726f2a2c73.tar.gz gitorious-mainline-outdated-0a7b4ac74b5ee6020894dd20a7267a726f2a2c73.tar.bz2 |
updated support files
Diffstat (limited to 'script/spec_server')
-rwxr-xr-x | script/spec_server | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/script/spec_server b/script/spec_server index cac91e2..d48df92 100755 --- a/script/spec_server +++ b/script/spec_server @@ -6,27 +6,41 @@ require 'drb/drb' require 'rbconfig' require 'spec' require 'optparse' -specmate = ENV['HOME'] + "/Library/Application\ Support/TextMate/Bundles/RSpec.tmbundle/Support/lib" -if File.directory?(specmate) - $LOAD_PATH.unshift(specmate) - require 'text_mate_formatter' -end # This is based on Florian Weber's TDDMate - module Spec module Runner class RailsSpecServer - def run(args, stderr, stdout) - $stdout = stdout - $stderr = stderr + def run(argv, stderr, stdout) + $stdout = stdout + $stderr = stderr + + base = ActiveRecord::Base + def base.clear_reloadable_connections! + active_connections.each do |name, conn| + if conn.requires_reloading? + conn.disconnect! + active_connections.delete(name) + end + end + end - ::Dispatcher.reset_application! + if ::Dispatcher.respond_to?(:cleanup_application) + ::Dispatcher.cleanup_application + elsif ::Dispatcher.respond_to?(:reset_application!) + ::Dispatcher.reset_application! + end ::Dependencies.mechanism = :load require_dependency('application.rb') unless Object.const_defined?(:ApplicationController) load File.dirname(__FILE__) + '/../spec/spec_helper.rb' - - ::Spec::Runner::CommandLine.run(args, stderr, stdout, false, true) + + ::Spec::Runner::CommandLine.run( + ::Spec::Runner::OptionParser.parse( + argv, + $stderr, + $stdout + ) + ) end end end @@ -43,7 +57,7 @@ def restart_test_server ruby = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT'] command_line = [ruby, $0, ARGV].flatten.join(' ') exec(command_line) -end +end def daemonize(pid_file = nil) return yield if $DEBUG @@ -83,4 +97,3 @@ if options[:daemon] else exec_server.call end - |