diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-17 14:53:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 14:53:36 -0500 |
commit | bfea6f292b19f34216b643b6193be0a9867fc2cc (patch) | |
tree | 652eb7df106e28b88f1e42863890ca085c5ed417 /railties/test/application | |
parent | c24be369322b9e0211fcef30003375de195ef660 (diff) | |
parent | ed44b145bd6d621cd19a4a3c94eff1311e9c3755 (diff) | |
download | rails-bfea6f292b19f34216b643b6193be0a9867fc2cc.tar.gz rails-bfea6f292b19f34216b643b6193be0a9867fc2cc.tar.bz2 rails-bfea6f292b19f34216b643b6193be0a9867fc2cc.zip |
Merge pull request #26343 from ccutrer/runner_from_stdin
support `-` as an argument to `rails runner`
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/runner_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb index 0c45bc398a..81f717b2c3 100644 --- a/railties/test/application/runner_test.rb +++ b/railties/test/application/runner_test.rb @@ -84,6 +84,14 @@ module ApplicationTests assert_match %w( a b ).to_s, Dir.chdir(app_path) { `bin/rails runner "bin/program_name.rb" a b` } end + def test_should_run_stdin + app_file "bin/count_users.rb", <<-SCRIPT + puts User.count + SCRIPT + + assert_match "42", Dir.chdir(app_path) { `cat bin/count_users.rb | bin/rails runner -` } + end + def test_with_hook add_to_config <<-RUBY runner do |app| |