diff options
author | Dominic Cleal <dominic@cleal.org> | 2017-01-25 15:58:11 +0000 |
---|---|---|
committer | Dominic Cleal <dominic@cleal.org> | 2017-02-04 13:54:52 +0100 |
commit | 1c8a4cdf63134f34d638703a956c2706d8e3789f (patch) | |
tree | 9b97fd307605aeeea935851e43731cc55225c04c /railties/test/application | |
parent | d833e9346839a3e8fca6098e3a5e456354873f8f (diff) | |
download | rails-1c8a4cdf63134f34d638703a956c2706d8e3789f.tar.gz rails-1c8a4cdf63134f34d638703a956c2706d8e3789f.tar.bz2 rails-1c8a4cdf63134f34d638703a956c2706d8e3789f.zip |
Collect all file patterns when running multiple rake test tasks
Replaces the rake_patterns instance variable with simple require, as
`autorun` will run tests from all eagerly required test files.
Fixes #27801
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 4e36d126fc..d3d5b6d6dd 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -536,6 +536,21 @@ module ApplicationTests assert_match "seed=1234", output, "passing TEST= should run selected test" end + def test_rake_runs_multiple_test_tasks + create_test_file :models, "account" + create_test_file :controllers, "accounts_controller" + output = Dir.chdir(app_path) { `bin/rake test:models test:controllers TESTOPTS='-v'` } + assert_match "AccountTest#test_truth", output + assert_match "AccountsControllerTest#test_truth", output + end + + def test_rake_db_and_test_tasks_parses_args_correctly + create_test_file :models, "account" + output = Dir.chdir(app_path) { `bin/rake db:migrate test:models TESTOPTS='-v' && echo ".tables" | rails dbconsole` } + assert_match "AccountTest#test_truth", output + assert_match "ar_internal_metadata", output + end + def test_warnings_option app_file "test/models/warnings_test.rb", <<-RUBY require 'test_helper' |