diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-11-12 13:42:17 +0300 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-11-12 13:42:17 +0300 |
commit | 2a31ea5545dbbeeafaaabb622a3053e361018898 (patch) | |
tree | f075c0d15efda8edd0ab95eb2fb456862b893407 /railties | |
parent | 46f172798e56ba5383ba5305e2cce5aad02e8e30 (diff) | |
parent | 3b12abba3c4fa0dbd6e8c92bd68fa433847d142c (diff) | |
download | rails-2a31ea5545dbbeeafaaabb622a3053e361018898.tar.gz rails-2a31ea5545dbbeeafaaabb622a3053e361018898.tar.bz2 rails-2a31ea5545dbbeeafaaabb622a3053e361018898.zip |
Merge pull request #17348 from DavidGeukers/rake_test_all
simplify rake test vs rake test:all
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 6 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 23 |
2 files changed, 26 insertions, 3 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index ca2bd62b43..d1da34588b 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -181,4 +181,10 @@ *Yves Senn*, *Carlos Antonio da Silva*, *Robin Dupret* +* Make `rake test` run all tests in test folder. + + Deprecate `rake test:all` and replace `rake test:all:db` with `rake test:db` + + *David Geukers* + Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md) for previous changes. diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 957deb8a60..0d0cfa3c6b 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -3,7 +3,7 @@ require 'rails/test_unit/sub_test_task' task default: :test -desc 'Runs test:units, test:functionals, test:generators, test:integration, test:jobs together' +desc "Runs all tests in test folder" task :test do Rails::TestTask.test_creator(Rake.application.top_level_tasks).invoke_rake_task end @@ -13,17 +13,34 @@ namespace :test do # Placeholder task for other Railtie and plugins to enhance. See Active Record for an example. end - task :run => ['test:units', 'test:functionals', 'test:generators', 'test:integration', 'test:jobs'] + Rails::TestTask.new(:run) do |t| + t.pattern = "test/**/*_test.rb" + end + + desc "Run tests quickly, but also reset db" + task :db => %w[db:test:prepare test] - # Inspired by: http://ngauthier.com/2012/02/quick-tests-with-bash.html desc "Run tests quickly by merging all types and not resetting db" Rails::TestTask.new(:all) do |t| t.pattern = "test/**/*_test.rb" end + Rake::Task["test:all"].enhance do + Rake::Task["test:deprecate_all"].invoke + end + + task :deprecate_all do + ActiveSupport::Deprecation.warn "rake test:all is deprecated and will be removed in Rails 5. " \ + "Use rake test to run all tests in test directory." + end + namespace :all do desc "Run tests quickly, but also reset db" task :db => %w[db:test:prepare test:all] + + Rake::Task["test:all:db"].enhance do + Rake::Task["test:deprecate_all"].invoke + end end Rails::TestTask.new(single: "test:prepare") |