##// END OF EJS Templates
Fixes test templates for plugins....
Jean-Philippe Lang -
r9554:afbff44fb4c7
parent child
Show More
@@ -1,33 +1,37
1 class RedminePluginGenerator < Rails::Generators::NamedBase
1 class RedminePluginGenerator < Rails::Generators::NamedBase
2 source_root File.expand_path("../templates", __FILE__)
2 source_root File.expand_path("../templates", __FILE__)
3
3
4 attr_reader :plugin_path, :plugin_name, :plugin_pretty_name
4 attr_reader :plugin_path, :plugin_name, :plugin_pretty_name
5
5
6 def initialize(*args)
6 def initialize(*args)
7 super
7 super
8 @plugin_name = file_name.underscore
8 @plugin_name = file_name.underscore
9 @plugin_pretty_name = plugin_name.titleize
9 @plugin_pretty_name = plugin_name.titleize
10 @plugin_path = "plugins/#{plugin_name}"
10 @plugin_path = "plugins/#{plugin_name}"
11 end
11 end
12
12
13 def copy_templates
13 def copy_templates
14 empty_directory "#{plugin_path}/app"
14 empty_directory "#{plugin_path}/app"
15 empty_directory "#{plugin_path}/app/controllers"
15 empty_directory "#{plugin_path}/app/controllers"
16 empty_directory "#{plugin_path}/app/helpers"
16 empty_directory "#{plugin_path}/app/helpers"
17 empty_directory "#{plugin_path}/app/models"
17 empty_directory "#{plugin_path}/app/models"
18 empty_directory "#{plugin_path}/app/views"
18 empty_directory "#{plugin_path}/app/views"
19 empty_directory "#{plugin_path}/db/migrate"
19 empty_directory "#{plugin_path}/db/migrate"
20 empty_directory "#{plugin_path}/lib/tasks"
20 empty_directory "#{plugin_path}/lib/tasks"
21 empty_directory "#{plugin_path}/assets/images"
21 empty_directory "#{plugin_path}/assets/images"
22 empty_directory "#{plugin_path}/assets/javascripts"
22 empty_directory "#{plugin_path}/assets/javascripts"
23 empty_directory "#{plugin_path}/assets/stylesheets"
23 empty_directory "#{plugin_path}/assets/stylesheets"
24 empty_directory "#{plugin_path}/config/locales"
24 empty_directory "#{plugin_path}/config/locales"
25 empty_directory "#{plugin_path}/test"
25 empty_directory "#{plugin_path}/test"
26 empty_directory "#{plugin_path}/test/fixtures"
27 empty_directory "#{plugin_path}/test/unit"
28 empty_directory "#{plugin_path}/test/functional"
29 empty_directory "#{plugin_path}/test/integration"
26
30
27 template 'README.rdoc', "#{plugin_path}/README.rdoc"
31 template 'README.rdoc', "#{plugin_path}/README.rdoc"
28 template 'init.rb.erb', "#{plugin_path}/init.rb"
32 template 'init.rb.erb', "#{plugin_path}/init.rb"
29 template 'routes.rb', "#{plugin_path}/config/routes.rb"
33 template 'routes.rb', "#{plugin_path}/config/routes.rb"
30 template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
34 template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
31 template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
35 template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
32 end
36 end
33 end
37 end
@@ -1,8 +1,8
1 require File.dirname(__FILE__) + '/../test_helper'
1 require File.expand_path('../../test_helper', __FILE__)
2
2
3 class <%= @controller_class %>ControllerTest < ActionController::TestCase
3 class <%= @controller_class %>ControllerTest < ActionController::TestCase
4 # Replace this with your real tests.
4 # Replace this with your real tests.
5 def test_truth
5 def test_truth
6 assert true
6 assert true
7 end
7 end
8 end
8 end
@@ -1,9 +1,9
1 require File.dirname(__FILE__) + '/../test_helper'
1 require File.expand_path('../../test_helper', __FILE__)
2
2
3 class <%= @model_class %>Test < ActiveSupport::TestCase
3 class <%= @model_class %>Test < ActiveSupport::TestCase
4
4
5 # Replace this with your real tests.
5 # Replace this with your real tests.
6 def test_truth
6 def test_truth
7 assert true
7 assert true
8 end
8 end
9 end
9 end
General Comments 0
You need to be logged in to leave comments. Login now