Sha256: 2570effed3294b1cd939d8fc472b9920d9becec201030d2b2383b77908ed428a

Contents?: true

Size: 726 Bytes

Versions: 2

Compression:

Stored size: 726 Bytes

Contents

require 'rails_generator'

module PluginTestHelper
  # The base generator for creating parts of the test application. The first
  # argument of the generator is always the name of the plugin.
  class Generator < Rails::Generator::NamedBase
    attr_accessor :plugin_name
    
    def initialize(*runtime_args) #:nodoc:
      @plugin_name = runtime_args.first.shift if runtime_args.first.is_a?(Array)
      super(*runtime_args)
    end
    
    private
      # The root path of the plugin's test directory
      def plugin_test_root
        "vendor/plugins/#{plugin_name}/test"
      end
      
      # The root path of the plugin's test app
      def plugin_app_root
        "#{plugin_test_root}/app_root"
      end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plugin_test_helper-0.2.0 lib/plugin_test_helper/generator.rb
plugin_test_helper-0.2.1 lib/plugin_test_helper/generator.rb