aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-11-20 16:02:39 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-11-20 16:02:39 +0100
commit5aea0952e7cb445e614652e3cd9aba71a836eed0 (patch)
tree531d01b0f6aa2ec860c31f7f71b77200ac21202a /railties/test/application
parente6c808e354cdc2a8d9274caa6668fdfc145a255d (diff)
downloadrails-5aea0952e7cb445e614652e3cd9aba71a836eed0.tar.gz
rails-5aea0952e7cb445e614652e3cd9aba71a836eed0.tar.bz2
rails-5aea0952e7cb445e614652e3cd9aba71a836eed0.zip
Pass `rails runner` args onto file again.
When making the new command insfrastructure I had missed that `bin/rails runner some_file.rb some args` would pass the extra args onto the file in `ARGV`. Now fixed by allowing the command to take extra args again, and make sure to remove the file name from `ARGV`.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/runner_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb
index 8769703f66..7d058f6ee6 100644
--- a/railties/test/application/runner_test.rb
+++ b/railties/test/application/runner_test.rb
@@ -68,6 +68,14 @@ module ApplicationTests
assert_match "bin/program_name.rb", Dir.chdir(app_path) { `bin/rails runner "bin/program_name.rb"` }
end
+ def test_passes_extra_args_to_file
+ app_file "bin/program_name.rb", <<-SCRIPT
+ p ARGV
+ SCRIPT
+
+ assert_match %w( a b ).to_s, Dir.chdir(app_path) { `bin/rails runner "bin/program_name.rb" a b` }
+ end
+
def test_with_hook
add_to_config <<-RUBY
runner do |app|