diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-02-17 17:37:43 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-02-17 17:38:40 +0000 |
commit | 870d948c27607634e94eaca467cefa0e66ac0eb1 (patch) | |
tree | 3a78c99de999d532f5c403ca06ef60dfb37ca102 | |
parent | b6686781bd378c44e7ccf3557969547c61e9248f (diff) |
Prevent Autorunner from test-unit from hooking into the exit of script/runner
-rwxr-xr-x | script/runner | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/script/runner b/script/runner index 2bd5e9aa7..cb34f9187 100755 --- a/script/runner +++ b/script/runner @@ -1,7 +1,11 @@ #!/usr/bin/env ruby daemon_mode = !ARGV.empty? && ARGV[0] == "--daemon" - +if Rails.env == 'test' + # Avoid spec/script/mailin_spec.rb running script/runner as a test suite + # http://stackoverflow.com/questions/1899009/why-are-tests-running-in-production-mode-and-causing-my-script-runners-to-fail + Test::Unit.run = true +end script_dir = File.dirname(__FILE__) alaveteli_dir = File.expand_path(File.join(script_dir, "..")) @@ -31,7 +35,7 @@ Dir.chdir(alaveteli_dir) do fh.puts pid end end - + Process.detach(pid) else # Not daemon mode |