aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit/line_filtering.rb
Commit message (Collapse)AuthorAgeFilesLines
* applies new string literal convention in railties/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix mixing line filters with Minitest's -n filter.Kasper Timm Hansen2016-02-051-4/+12
| | | | | | | | | | | Previous commit accidentally broke mixing line filters with string -n filter. Fix by checking if it is a string and returning it. We also need to ensure the -n filter carry forward into any other composite filters. Fix by letting the named filter be extractable, so we'll keep this for the next runnable's run.
* Fix line filters running tests from multiple runnables.Kasper Timm Hansen2016-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | `derive_regexp` was written with the assumption that we were run from a blank slate — that if the filter didn't match we might as well return it because it was nil. This isn't the case because minitest calls `run` on every runnable. Which is any subclass of Minitest::Runnable, such as ActiveSupport::TestCase, ActionDispatch::IntegrationTest as well as any inheriting from those. Thus after the first `run` we'd have put in a composite filter in `options[:filter]` making the next `run` create a linked list when it failed to match the regexp and put the composite filter as the head. Every runnable would accumulate more and more of the same filters, which effectively acted like an expanding whitelist and we ran tests from other runnables. Clog the accumulation by returning nil if there's no filter to derive a regexp from. Note: we pass a seed in the tests because Minitest shuffles the runnables to ensure the whitelist is expanded enough that the failure is triggered.
* Added multiple line filters support for test runnerSiva Gollapalli2016-01-101-3/+8
|
* [ci skip] Clarify some Minitest origins.Kasper Timm Hansen2016-01-091-0/+2
| | | | | It might be tough for readers to know why we implement `===`, and where the Regexp in `derive_regexp` came from.
* Extract line filtering to Railties.Kasper Timm Hansen2016-01-091-0/+63
The line filter parsing added to ActiveSupport::TestCase is only half the story to enable line filtering. The other half, of adding the patterns to the options, is done in the Minitest plugin that Railties has. Thus it makes more sense to have the filter in Railties with the other half and all the line filtering tests. Move the filter and extend Active Support in an initializer, so that when users or `rails/all.rb` require `rails/test_unit/railtie` we can still filter by line.