diff options
Diffstat (limited to 'railties/lib/generators/test_unit')
-rw-r--r-- | railties/lib/generators/test_unit/helper/helper_generator.rb | 13 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/helper/templates/helper_test.rb | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/railties/lib/generators/test_unit/helper/helper_generator.rb b/railties/lib/generators/test_unit/helper/helper_generator.rb new file mode 100644 index 0000000000..e7fc4e0dbd --- /dev/null +++ b/railties/lib/generators/test_unit/helper/helper_generator.rb @@ -0,0 +1,13 @@ +module TestUnit + module Generators + class HelperGenerator < Base + def check_class_collisions + class_collisions "#{class_name}Helper" + end + + def create_helper_files + template 'helper_test.rb', File.join('test/unit/helpers', class_path, "#{file_name}_helper_test.rb") + end + end + end +end diff --git a/railties/lib/generators/test_unit/helper/templates/helper_test.rb b/railties/lib/generators/test_unit/helper/templates/helper_test.rb new file mode 100644 index 0000000000..591e40900e --- /dev/null +++ b/railties/lib/generators/test_unit/helper/templates/helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class <%= class_name %>HelperTest < ActionView::TestCase +end |