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 164e3b6 commit 68034efea1d915096a4d83343a927d8551e3c1fd @rohit rohit committed with spastorino Sep 19, 2010
Showing with 5 additions and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/runner.rb
  2. +4 −0 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 ""
@@ -18,6 +18,10 @@ def self.count
MODEL
end
+ def test_should_include_runner_in_shebang_line_in_help
+ assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help` }
+ end
+
def test_should_run_ruby_statement
assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "puts User.count"` }
end

0 comments on commit 68034ef

Please sign in to comment.