make 'rails runner' show usage when run without any options
This commit is contained in:
parent
78acd17f31
commit
880371ef2b
@ -4,6 +4,10 @@
|
||||
options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
|
||||
code_or_file = nil
|
||||
|
||||
if ARGV.first.nil?
|
||||
ARGV.push "-h"
|
||||
end
|
||||
|
||||
ARGV.clone.options do |opts|
|
||||
script_name = File.basename($0)
|
||||
opts.banner = "Usage: runner [options] ('Some.ruby(code)' or a filename)"
|
||||
|
@ -22,6 +22,10 @@ def teardown
|
||||
teardown_app
|
||||
end
|
||||
|
||||
def test_should_include_runner_in_shebang_line_in_help_without_option
|
||||
assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner` }
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user