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/test_unit | |
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/test_unit')
4 files changed, 45 insertions, 0 deletions
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/test_unit/integration/templates/integration_test.rb b/railties/lib/generators/test_unit/integration/templates/integration_test.rb new file mode 100644 index 0000000000..2c57158b1c --- /dev/null +++ b/railties/lib/generators/test_unit/integration/templates/integration_test.rb @@ -0,0 +1,10 @@ +require 'test_helper' + +class <%= class_name %>Test < ActionController::IntegrationTest + fixtures :all + + # Replace this with your real tests. + test "the truth" do + assert true + end +end 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/test_unit/performance/templates/performance_test.rb b/railties/lib/generators/test_unit/performance/templates/performance_test.rb new file mode 100644 index 0000000000..27c91b0fca --- /dev/null +++ b/railties/lib/generators/test_unit/performance/templates/performance_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' +require 'performance_test_help' + +class <%= class_name %>Test < ActionController::PerformanceTest + # Replace this with your real tests. + def test_homepage + get '/' + end +end |