From 7a36686c115f1c6c60ac0a51bc4991c3d32b6e5d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 22 Feb 2016 16:14:14 -0800 Subject: make sure `rake test` respects TESTOPTS We should be able to pass options to minitest via TESTOPTS environment variable --- railties/test/application/test_runner_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'railties/test') 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}` } -- cgit v1.2.3