diff options
author | Prem Sichanugrist <s@sikac.hu> | 2013-02-01 17:21:09 -0500 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2013-03-09 16:03:55 -0500 |
commit | 176b57c5430ddae7668114994c35b3293b0a05a5 (patch) | |
tree | 6128b0b1c415c12e54eeaf5808707d27d926093c /railties/test/application | |
parent | 9f75f7735ac387e9d44db511c5cef7b7453f6bba (diff) | |
download | rails-176b57c5430ddae7668114994c35b3293b0a05a5.tar.gz rails-176b57c5430ddae7668114994c35b3293b0a05a5.tar.bz2 rails-176b57c5430ddae7668114994c35b3293b0a05a5.zip |
Add support for MiniTest flags in TestRunner
Any flags that got set will be passed through to MiniTest::Unit.runner,
such as `-n`, `-s-, and `-v`.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 49bce508ee..249bfd1d5d 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -149,6 +149,27 @@ module ApplicationTests end end + def test_run_named_test + app_file 'test/unit/chu_2_koi_test.rb', <<-RUBY + require 'test_helper' + + class Chu2KoiTest < ActiveSupport::TestCase + def test_rikka + puts 'Rikka' + end + + def test_sanae + puts 'Sanae' + end + end + RUBY + + run_test_command('test/unit/chu_2_koi_test.rb -n test_rikka').tap do |output| + assert_match /Rikka/, output + assert_no_match /Sanae/, output + end + end + private def run_test_command(arguments = 'test/unit/test_test.rb') Dir.chdir(app_path) { `bundle exec rails test #{arguments}` } |