aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revise setting of run_with_rails_extension.Kasper Timm Hansen2016-09-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The Rails test runner supports three ways to run tests: directly, via rake, or ruby. When Running with Ruby ala `ruby -Itest test/models/post_test.rb` our test file would be evaluated first, requiring `test_helper` and then `active_support/testing/autorun` that would then require the test file (which it hadn't been before) thus reevaluating it. This caused exceptions if using Active Support's declarative syntax. Fix this by shifting around when we set the how we're run to closer mimick the require order. If we're running with `bin/rails test` the test command file is run first and we then set `run_with_rails_extension`, later we hit `active_support/testing/autorun` and do nothing — because we've been run elsewhere. If we at this point haven't set `run_with_rails_extension` we've been running with `ruby` this whole time and thus we set that. We should always trigger `Minitest.autorun` as it doesn't hurt to call it twice. Consolidate the two methods into a single one that better brings out the intent of why they're there.
* Require `active_support/testing/autorun`.Kasper Timm Hansen2016-09-251-2/+1
| | | | | | | | Revise the require in the test command to use `active_support/testing/autorun` and spare us the minitest spec syntax as detailed in 5da4d51. Also move the require to the top of the file for consistency with the rest of Rails' requires across the project.
* switch to autorun to support after_run and patch lessMichael Grosser2016-09-231-3/+1
|
* support minitest after_run for parity to regular minitestMichael Grosser2016-09-161-1/+3
| | | | see https://github.com/seattlerb/minitest/blob/f9605387e4af7d657921a83aaf0ae364f6d26a57/lib/minitest.rb#L51-L65
* improve test coverageMichael Grosser2016-09-161-2/+2
|
* 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.
* make test runner work correctly inside engineyuuji.yaginuma2015-07-121-1/+5
|
* Improve test runner's Minitest integration.Kasper Timm Hansen2015-06-041-2/+2
| | | | | | | | | | | This also adds free mix and matching of directories, files and lines filters. Like so: bin/rails test models/post_test.rb test/integration models/person_test.rb:26 You can also mix in a traditional Minitest filter: bin/rails test test/integration -n /check_it_out/
* `-e` / `--environment` for the test runner.Yves Senn2015-03-181-1/+1
|
* move argument parsing into the `Runner`.Yves Senn2015-03-181-3/+1
|
* Move some logic to runnerArthur Neves2015-03-181-13/+1
|
* no need to escape the method in a regex wrap, minitest does that for usArthur Neves2015-03-181-1/+1
|
* Add test run by line, and report error by lineArthur Neves2015-03-181-3/+13
|
* spike of a `OptionParser` backed test runner.Yves Senn2015-03-181-0/+9