From ea106cf051e4fafcaf775f75bc4af17e89197a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 23 Jun 2009 20:42:29 +0200 Subject: Added plugin generators (and a couple of TODOs). --- railties/lib/generators/test_unit/plugin/USAGE | 13 +++++++++++++ .../lib/generators/test_unit/plugin/plugin_generator.rb | 14 ++++++++++++++ .../test_unit/plugin/templates/test/%file_name%_test.rb | 8 ++++++++ .../test_unit/plugin/templates/test/test_helper.rb | 3 +++ 4 files changed, 38 insertions(+) create mode 100644 railties/lib/generators/test_unit/plugin/USAGE create mode 100644 railties/lib/generators/test_unit/plugin/plugin_generator.rb create mode 100644 railties/lib/generators/test_unit/plugin/templates/test/%file_name%_test.rb create mode 100644 railties/lib/generators/test_unit/plugin/templates/test/test_helper.rb (limited to 'railties/lib/generators/test_unit') 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 <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 -- cgit v1.2.3