1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Send 'rails runner' help message to stdout instead of stderr.

[#5661 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
rohit 2010-09-19 13:09:42 +05:30 committed by Santiago Pastorino
parent 88a82bcb2d
commit fd53bc85e7
2 changed files with 2 additions and 3 deletions

View file

@ -17,7 +17,7 @@ ARGV.clone.options do |opts|
opts.separator ""
opts.on("-h", "--help",
"Show this help message.") { $stderr.puts opts; exit }
"Show this help message.") { $stdout.puts opts; exit }
if RbConfig::CONFIG['host_os'] !~ /mswin|mingw/
opts.separator ""

View file

@ -19,8 +19,7 @@ module ApplicationTests
end
def test_should_include_runner_in_shebang_line_in_help
# redirect stderr to stdout as backticks don't capture stderr
assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help 2>&1` }
assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help` }
end
def test_should_run_ruby_statement