diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 16:38:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 16:38:37 -0700 |
commit | 88cf64a6690e3c7cc05bd644bd5ad9a000192ebd (patch) | |
tree | 429feb9ee5a4631834dbcdcddc0cc6c71638757f /railties/test/application | |
parent | 7f698da8878b141c5324b2419d73570f507ef08f (diff) | |
download | rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.tar.gz rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.tar.bz2 rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.zip |
extract test info from the command line and set up the test task
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 180fc315d1..c82ac8b5d3 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -155,7 +155,28 @@ module ApplicationTests end RUBY - run_test_command('test/unit/chu_2_koi_test.rb TESTOPTS="-n test_rikka"').tap do |output| + run_test_command('test/unit/chu_2_koi_test.rb test_rikka').tap do |output| + assert_match "Rikka", output + assert_no_match "Sanae", output + end + end + + def test_run_matched_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 /rikka/').tap do |output| assert_match "Rikka", output assert_no_match "Sanae", output end |