diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-03 22:55:50 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-03 22:55:50 +0100 |
commit | 13b918d1e9ebe2c609b5479550a35f3665c2acd2 (patch) | |
tree | 3a0cc702e50928cb3f9d7341a3710c28cf3fcd1e /railties/test | |
parent | a14cd3261c50b6eb0eb23c852a45bf7c253bf5aa (diff) | |
parent | d10b48dd0aa00504212cb6f8598e5c1b7d0d968e (diff) | |
download | rails-13b918d1e9ebe2c609b5479550a35f3665c2acd2.tar.gz rails-13b918d1e9ebe2c609b5479550a35f3665c2acd2.tar.bz2 rails-13b918d1e9ebe2c609b5479550a35f3665c2acd2.zip |
Merge pull request #23456 from kaspth/line-filter-triggers-one-runnable
Fix line filters running tests from multiple runnables.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index a7eb0feb11..821ac9b033 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -363,7 +363,7 @@ module ApplicationTests end RUBY - run_test_command('test/models/account_test.rb:4:9 test/models/post_test:4:9').tap do |output| + run_test_command('test/models/account_test.rb:4:9 test/models/post_test.rb:4:9').tap do |output| assert_match 'AccountTest:FirstFilter', output assert_match 'AccountTest:SecondFilter', output assert_match 'PostTest:FirstFilter', output @@ -382,6 +382,30 @@ module ApplicationTests end end + def test_line_filters_trigger_only_one_runnable + app_file 'test/models/post_test.rb', <<-RUBY + require 'test_helper' + + class PostTest < ActiveSupport::TestCase + test 'truth' do + assert true + end + end + + class SecondPostTest < ActiveSupport::TestCase + test 'truth' do + assert false, 'ran second runnable' + end + end + RUBY + + # Pass seed guaranteeing failure. + run_test_command('test/models/post_test.rb:4 --seed 30410').tap do |output| + assert_no_match 'ran second runnable', output + assert_match '1 runs, 1 assertions', output + end + end + def test_shows_filtered_backtrace_by_default create_backtrace_test |