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/lib/generators | |
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/lib/generators')
-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 |
6 files changed, 28 insertions, 10 deletions
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 |