diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2016-02-22 16:14:14 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2016-02-22 16:14:14 -0800 |
commit | 7a36686c115f1c6c60ac0a51bc4991c3d32b6e5d (patch) | |
tree | d8ec6d272db20d3d3f04457214cdd291c478124f /railties/test | |
parent | 353782652b7dae7573f6480439519f227c41185a (diff) | |
download | rails-7a36686c115f1c6c60ac0a51bc4991c3d32b6e5d.tar.gz rails-7a36686c115f1c6c60ac0a51bc4991c3d32b6e5d.tar.bz2 rails-7a36686c115f1c6c60ac0a51bc4991c3d32b6e5d.zip |
make sure `rake test` respects TESTOPTS
We should be able to pass options to minitest via TESTOPTS environment
variable
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index b0f348f3f1..1e0fbddb58 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -502,6 +502,19 @@ module ApplicationTests assert_match '1 runs, 1 assertions', output end + def test_rake_passes_TESTOPTS_to_minitest + create_test_file :models, 'account' + output = Dir.chdir(app_path) { `bin/rake test TESTOPTS=-v` } + assert_match "AccountTest#test_truth", output, "passing TEST= should run selected test" + end + + def test_rake_passes_multiple_TESTOPTS_to_minitest + create_test_file :models, 'account' + output = Dir.chdir(app_path) { `bin/rake test TESTOPTS='-v --seed=1234'` } + assert_match "AccountTest#test_truth", output, "passing TEST= should run selected test" + assert_match "seed=1234", output, "passing TEST= should run selected test" + end + private def run_test_command(arguments = 'test/unit/test_test.rb') Dir.chdir(app_path) { `bin/rails t #{arguments}` } |