diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-23 20:42:29 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-23 20:42:29 +0200 |
commit | ea106cf051e4fafcaf775f75bc4af17e89197a28 (patch) | |
tree | b83f5e46884b25a5ad88471f43427cbb275487ca /railties/lib/generators/test_unit | |
parent | d7bab3a43a72b94775c857865817004408549e70 (diff) | |
download | rails-ea106cf051e4fafcaf775f75bc4af17e89197a28.tar.gz rails-ea106cf051e4fafcaf775f75bc4af17e89197a28.tar.bz2 rails-ea106cf051e4fafcaf775f75bc4af17e89197a28.zip |
Added plugin generators (and a couple of TODOs).
Diffstat (limited to 'railties/lib/generators/test_unit')
4 files changed, 38 insertions, 0 deletions
diff --git a/railties/lib/generators/test_unit/plugin/USAGE b/railties/lib/generators/test_unit/plugin/USAGE new file mode 100644 index 0000000000..8a17fa4dec --- /dev/null +++ b/railties/lib/generators/test_unit/plugin/USAGE @@ -0,0 +1,13 @@ +Description: + Stubs out a new plugin at vendor/plugins. Pass the plugin name, either + CamelCased or under_scored, as an argument. + +Example: + `./script/generate plugin BrowserFilters` + + creates a standard browser_filters plugin: + vendor/plugins/browser_filters/README + vendor/plugins/browser_filters/init.rb + vendor/plugins/browser_filters/install.rb + vendor/plugins/browser_filters/lib/browser_filters.rb + vendor/plugins/browser_filters/test/browser_filters_test.rb diff --git a/railties/lib/generators/test_unit/plugin/plugin_generator.rb b/railties/lib/generators/test_unit/plugin/plugin_generator.rb new file mode 100644 index 0000000000..1c987ab1c9 --- /dev/null +++ b/railties/lib/generators/test_unit/plugin/plugin_generator.rb @@ -0,0 +1,14 @@ +module TestUnit + module Generators + class PluginGenerator < Base + desc <<DESC +Description: + Create TestUnit files for plugin generator. +DESC + + def create_test_files + directory 'test' + end + end + end +end diff --git a/railties/lib/generators/test_unit/plugin/templates/test/%file_name%_test.rb b/railties/lib/generators/test_unit/plugin/templates/test/%file_name%_test.rb new file mode 100644 index 0000000000..3e0bc29d3a --- /dev/null +++ b/railties/lib/generators/test_unit/plugin/templates/test/%file_name%_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class <%= class_name %>Test < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/railties/lib/generators/test_unit/plugin/templates/test/test_helper.rb b/railties/lib/generators/test_unit/plugin/templates/test/test_helper.rb new file mode 100644 index 0000000000..cf148b8b47 --- /dev/null +++ b/railties/lib/generators/test_unit/plugin/templates/test/test_helper.rb @@ -0,0 +1,3 @@ +require 'rubygems' +require 'active_support' +require 'active_support/test_case'
\ No newline at end of file |