mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04: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:
committed by
Santiago Pastorino
parent
88a82bcb2d
commit
fd53bc85e7
@@ -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 ""
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user