diff options
author | Prem Sichanugrist <s@sikac.hu> | 2013-02-25 17:04:01 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 15:12:12 -0700 |
commit | ba602254f74e9f82825575a95b66b4127f24eee2 (patch) | |
tree | 125c0550d555df472db4187d7eb1e1a77be738a4 /railties/lib/rails/test_unit | |
parent | 91efe3958a7618db4030dd6ee5d8693145fb7b94 (diff) | |
download | rails-ba602254f74e9f82825575a95b66b4127f24eee2.tar.gz rails-ba602254f74e9f82825575a95b66b4127f24eee2.tar.bz2 rails-ba602254f74e9f82825575a95b66b4127f24eee2.zip |
Update Rake tasks to call `rails test` instead
Also, print out deprecation warning for other rake tasks except
`rake test` and `rake` (default)
Conflicts:
railties/lib/rails/test_unit/testing.rake
railties/test/application/rake_test.rb
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 07d2c192e4..bef819a8a8 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -1,6 +1,7 @@ require 'rbconfig' require 'rake/testtask' require 'rails/test_unit/sub_test_task' +require 'active_support/deprecation' TEST_CHANGES_SINCE = Time.now - 600 @@ -77,9 +78,13 @@ namespace :test do task :db => %w[db:test:prepare test:all] end - Rails::TestTask.new(recent: "test:prepare") do |t| - warn "DEPRECATION WARNING: `rake test:recent` is deprecated" + # Display deprecation message + task :deprecated do + task_name = ARGV.first + ActiveSupport::Deprecation.warn "`rake #{ARGV.first}` is deprecated with no replacement." + end + Rake::TestTask.new(recent: ["test:deprecated", "test:prepare"]) do |t| since = TEST_CHANGES_SINCE touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } + recent_tests('app/models/**/*.rb', 'test/models', since) + @@ -89,11 +94,9 @@ namespace :test do t.test_files = touched.uniq end - Rake::Task['test:recent'].comment = "Test recent changes" - - Rails::TestTask.new(uncommitted: "test:prepare") do |t| - warn "DEPRECATION WARNING: `rake test:uncommitted` is deprecated" + Rake::Task['test:recent'].comment = "Deprecated; Test recent changes" + Rake::TestTask.new(uncommitted: ["test:deprecated", "test:prepare"]) do |t| def t.file_list if File.directory?(".svn") changed_since_checkin = silence_stderr { `svn status` }.split.map { |path| path.chomp[7 .. -1] } @@ -113,7 +116,7 @@ namespace :test do (unit_tests + functional_tests).uniq.select { |file| File.exist?(file) } end end - Rake::Task['test:uncommitted'].comment = "Test changes since last checkin (only Subversion and Git)" + Rake::Task['test:uncommitted'].comment = "Deprecated; Test changes since last checkin (only Subversion and Git)" Rails::TestTask.new(single: "test:prepare") |