added ability to set the rails environment to run tests under

This commit is contained in:
Sean Kirby 2010-05-07 17:06:13 -04:00
parent aa4b315833
commit 133ad90894
2 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ module Hydra #:nodoc:
@verbose = opts.fetch('verbose') { false }
@autosort = opts.fetch('autosort') { true }
@sync = opts.fetch('sync') { nil }
@environment = opts.fetch('environment') { 'test' }
if @autosort
sort_files_from_report
@ -139,7 +140,7 @@ module Hydra #:nodoc:
runners = worker.fetch('runners') { raise "You must specify the number of runners" }
command = worker.fetch('command') {
"ruby -e \"require 'rubygems'; require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose});\""
"RAILS_ENV=#{@environment} ruby -e \"require 'rubygems'; require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose});\""
}
trace "Booting SSH worker"

View File

@ -188,7 +188,7 @@ module Hydra #:nodoc:
end
@listeners.each{|l| l.join}
$stdout.write "\n==== Hydra Running #{@name} COMPLETE ====\n\n"
$stdout.write @results.values.join('\n')
$stdout.write @results.values.join("\n")
end
end