Permalink
Browse files

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

[#5661 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 88a82bc commit fd53bc85e7c4f57edbff1dd68b37cca320efee77 @rohit rohit committed with spastorino Sep 19, 2010
Showing with 2 additions and 3 deletions.
  1. +1 −1 railties/lib/rails/commands/runner.rb
  2. +1 −2 railties/test/application/runner_test.rb
@@ -17,7 +17,7 @@
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 ""
@@ -19,8 +19,7 @@ def self.count
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

0 comments on commit fd53bc8

Please sign in to comment.