Adds a rails test:all rake task (#39221)

* Adds a rails test:all rake task

This task runs all tests, including system tests.

* Better placement + slight tweak of the comment

Co-authored-by: David Heinemeier Hansson <david@loudthinking.com>
This commit is contained in:
Niklas Häusele 2020-05-11 02:22:49 +02:00 committed by GitHub
parent f834f2aea8
commit 9488712365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -857,6 +857,7 @@ bin/rails test:system
NOTE: By default, running `bin/rails test` won't run your system tests.
Make sure to run `bin/rails test:system` to actually run them.
You can also run `bin/rails test:all` to run all tests, including system tests.
#### Creating Articles System Test

View File

@ -1,3 +1,9 @@
* Adds `rails test:all` for running all tests in the test directory.
This runs all test files in the test directory, including system tests.
*Niklas Häusele*
* Add `config.generators.after_generate` for processing to generated files.
Register a callback that will get called right after generators has finished.

View File

@ -35,6 +35,12 @@ namespace :test do
end
end
desc "Runs all tests, including system tests"
task all: "test:prepare" do
$: << "test"
Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"])
end
task generators: "test:prepare" do
$: << "test"
Rails::TestUnit::Runner.rake_run(["test/lib/generators"])