public
Description: Simplifies plugin testing by creating an isolated Rails environment that simulates its usage in a real application
Homepage: http://www.pluginaweek.org
Clone URL: git://github.com/pluginaweek/plugin_test_helper.git
plugin_test_helper / generators / plugin_test_helper / plugin_test_helper_generator.rb
100644 20 lines (16 sloc) 0.481 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Generates the test helper for a plugin
class PluginTestHelperGenerator < Rails::Generator::NamedBase
  def manifest #:nodoc:
    record do |m|
      plugin_root = "vendor/plugins/#{name}"
      
      # Test directory
      m.directory File.join(plugin_root, 'test')
      
      # Test helper
      m.file 'test_helper.rb', File.join(plugin_root, 'test/test_helper.rb')
    end
  end
  
  protected
    def banner
      "Usage: #{$0} plugin_test_helper your_plugin"
    end
end