diff options
Diffstat (limited to 'railties/lib/generators/test_unit/performance')
-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 | 9 |
2 files changed, 22 insertions, 0 deletions
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..362e3dc09f --- /dev/null +++ b/railties/lib/generators/test_unit/performance/templates/performance_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' +require 'rails/performance_test_help' + +class <%= class_name %>Test < ActionController::PerformanceTest + # Replace this with your real tests. + def test_homepage + get '/' + end +end |