diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-13 18:29:40 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-13 18:29:40 +0200 |
commit | b9f4ea7198aadaeaaf6761316f0d3c96e73e4753 (patch) | |
tree | 9383bc86c63ae8fc041f26a9b1e9304ce5f639a9 /railties | |
parent | f68e7a3987adf2cffe0e48263d117839c2028185 (diff) | |
download | rails-b9f4ea7198aadaeaaf6761316f0d3c96e73e4753.tar.gz rails-b9f4ea7198aadaeaaf6761316f0d3c96e73e4753.tar.bz2 rails-b9f4ea7198aadaeaaf6761316f0d3c96e73e4753.zip |
Add hooks for integration and performance tests.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/generators.rb | 2 | ||||
-rw-r--r-- | railties/lib/generators/rails/integration_test/integration_test_generator.rb | 6 | ||||
-rw-r--r-- | railties/lib/generators/rails/performance_test/performance_test_generator.rb | 6 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/integration/integration_generator.rb | 13 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/integration/templates/integration_test.rb (renamed from railties/lib/generators/rails/integration_test/templates/integration_test.rb) | 0 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/performance/performance_generator.rb | 13 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/performance/templates/performance_test.rb (renamed from railties/lib/generators/rails/performance_test/templates/performance_test.rb) | 0 |
7 files changed, 30 insertions, 10 deletions
diff --git a/railties/lib/generators.rb b/railties/lib/generators.rb index 8fe5dabf86..3cf4ccb79a 100644 --- a/railties/lib/generators.rb +++ b/railties/lib/generators.rb @@ -36,9 +36,11 @@ module Rails :fixture => true, :force_plural => false, :helper => true, + :integration_tool => :test_unit, :layout => true, :migration => true, :orm => :active_record, + :performance_tool => :test_unit, :resource_controller => :controller, :scaffold_controller => :scaffold_controller, :singleton => false, diff --git a/railties/lib/generators/rails/integration_test/integration_test_generator.rb b/railties/lib/generators/rails/integration_test/integration_test_generator.rb index b45ef1597c..363a327fcb 100644 --- a/railties/lib/generators/rails/integration_test/integration_test_generator.rb +++ b/railties/lib/generators/rails/integration_test/integration_test_generator.rb @@ -1,11 +1,7 @@ module Rails module Generators class IntegrationTestGenerator < NamedBase - check_class_collision :suffix => "Test" - - def create_test_files - template 'integration_test.rb', File.join('test/integration', class_path, "#{file_name}_test.rb") - end + hook_for :integration_tool, :as => :integration end end end diff --git a/railties/lib/generators/rails/performance_test/performance_test_generator.rb b/railties/lib/generators/rails/performance_test/performance_test_generator.rb index b8efda8df3..d1c71ab8ed 100644 --- a/railties/lib/generators/rails/performance_test/performance_test_generator.rb +++ b/railties/lib/generators/rails/performance_test/performance_test_generator.rb @@ -1,11 +1,7 @@ module Rails module Generators class PerformanceTestGenerator < NamedBase - check_class_collision :suffix => "Test" - - def create_test_files - template 'performance_test.rb', File.join('test/performance', class_path, "#{file_name}_test.rb") - end + hook_for :performance_tool, :as => :performance end end end diff --git a/railties/lib/generators/test_unit/integration/integration_generator.rb b/railties/lib/generators/test_unit/integration/integration_generator.rb new file mode 100644 index 0000000000..d9d9b3bf1d --- /dev/null +++ b/railties/lib/generators/test_unit/integration/integration_generator.rb @@ -0,0 +1,13 @@ +require 'generators/test_unit' + +module TestUnit + module Generators + class IntegrationGenerator < Base + check_class_collision :suffix => "Test" + + def create_test_files + template 'integration_test.rb', File.join('test/integration', class_path, "#{file_name}_test.rb") + end + end + end +end diff --git a/railties/lib/generators/rails/integration_test/templates/integration_test.rb b/railties/lib/generators/test_unit/integration/templates/integration_test.rb index 2c57158b1c..2c57158b1c 100644 --- a/railties/lib/generators/rails/integration_test/templates/integration_test.rb +++ b/railties/lib/generators/test_unit/integration/templates/integration_test.rb diff --git a/railties/lib/generators/test_unit/performance/performance_generator.rb b/railties/lib/generators/test_unit/performance/performance_generator.rb new file mode 100644 index 0000000000..0d9c646b26 --- /dev/null +++ b/railties/lib/generators/test_unit/performance/performance_generator.rb @@ -0,0 +1,13 @@ +require 'generators/test_unit' + +module TestUnit + module Generators + class PerformanceGenerator < Base + check_class_collision :suffix => "Test" + + def create_test_files + template 'performance_test.rb', File.join('test/performance', class_path, "#{file_name}_test.rb") + end + end + end +end diff --git a/railties/lib/generators/rails/performance_test/templates/performance_test.rb b/railties/lib/generators/test_unit/performance/templates/performance_test.rb index 27c91b0fca..27c91b0fca 100644 --- a/railties/lib/generators/rails/performance_test/templates/performance_test.rb +++ b/railties/lib/generators/test_unit/performance/templates/performance_test.rb |