diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-29 18:36:28 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-29 18:36:28 +0200 |
commit | 9a865ee25ea01c68015b46e69ca0589f0024a0d5 (patch) | |
tree | 3d8ea245cb7e344fe309a7a2226c7018821a48e7 /railties/lib/rails/tasks | |
parent | 94ced0854370490d3da91fd77b247c1b0922ac99 (diff) | |
download | rails-9a865ee25ea01c68015b46e69ca0589f0024a0d5.tar.gz rails-9a865ee25ea01c68015b46e69ca0589f0024a0d5.tar.bz2 rails-9a865ee25ea01c68015b46e69ca0589f0024a0d5.zip |
Revert "Reorganized app/test directory. [#3057 state:resolved]"
This reverts commit a0dc6755db71b33aebccdb95fd0dd7097c934c04.
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r-- | railties/lib/rails/tasks/framework.rake | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index a3109a9243..738f7f5301 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -17,7 +17,7 @@ namespace :rails do end desc "Update both configs, scripts and public/javascripts from Rails" - task :update => [ "update:configs", "update:javascripts", "update:scripts", "update:application_controller", "update:test_directory" ] + task :update => [ "update:configs", "update:javascripts", "update:scripts", "update:application_controller" ] desc "Applies the template supplied by LOCATION=/path/to/template" task :template do @@ -72,50 +72,5 @@ namespace :rails do puts "#{old_style} has been renamed to #{new_style}, update your SCM as necessary" end end - - desc "Move test directories to new locations" - task :test_directory do - if File.exists?(Rails.root.join('test')) - FileUtils.mkdir(Rails.root.join('test/controllers')) unless File.exists?(Rails.root.join('test/controllers')) - [Rails.root.join('test/functional'), Rails.root.join('test/integration')].each do |controller_test_dir| - if File.exists?(controller_test_dir) - puts "#{controller_test_dir} exists" - FileUtils.mv(Dir["#{controller_test_dir}/**/*"], Rails.root.join('test/controllers'), :force => true) - FileUtils.rm_rf(controller_test_dir) - end - end - - if File.exists?(Rails.root.join('test/unit/helpers')) - FileUtils.mkdir(Rails.root.join('test/helpers')) unless File.exists?(Rails.root.join('test/helpers')) - FileUtils.mv(Dir[Rails.root.join('test/unit/helpers/**/*')], Rails.root.join('test/helpers'), :force => true) - else - unless File.exists?(Rails.root.join('test/helpers')) - FileUtils.mkdir(Rails.root.join('test/helpers')) - end - end - - if File.exists?(Rails.root.join('test/unit')) - observer_tests = "#{Rails.root}/test/unit/**/*_observer_test.rb" - unless observer_tests.empty? - FileUtils.mkdir(Rails.root.join('test/observers')) unless File.exists?(Rails.root.join('test/observers')) - FileUtils.mv(observer_tests, Rails.root.join('test/observers'), :force => true) - end - FileUtils.mkdir(Rails.root.join('test/models')) unless File.exists?(Rails.root.join('test/models')) - FileUtils.mv(Dir[Rails.root.join('test/unit/*')], Rails.root.join('test/models'), :force => true) - FileUtils.rm_rf(Rails.root.join('test/unit')) - end - end - - puts <<-TEST - - All test directories have been updated: - - test/functional -> test/controllers - test/functional -> test/controllers - test/unit/helpers -> test/helpers - test/unit/**/*_observer_test.rb -> test/observers - test/unit -> test/models - TEST - end end end |