<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>generators/plugin_test_structure/templates/app_root/app/controllers/application_controller.rb</filename>
    </added>
    <added>
      <filename>test/app_roots/with_custom_application_controller/app/controllers/application_controller.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,10 @@
 == master
 
+* Fix environment being loaded twice when generators are loaded
+* Clean up / simplify generators
+* Rename application.rb to application_controller.rb
+* Add dependency on Rails 2.3
+
 == 0.2.1 / 2009-01-11
 
 * Remove init.rb since the library should never be loaded automatically</diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -104,7 +104,7 @@ Example:
         create  vendor/plugins/acts_as_most_popular/test/app_root/config/environments/in_memory.rb
         create  vendor/plugins/acts_as_most_popular/test/app_root/config/environments/postgresql.rb
         create  vendor/plugins/acts_as_most_popular/test/app_root/app/controllers
-        create  vendor/plugins/acts_as_most_popular/test/app_root/app/controllers/application.rb
+        create  vendor/plugins/acts_as_most_popular/test/app_root/app/controllers/application_controller.rb
   Loaded suite script/generate
   Started
   
@@ -187,7 +187,7 @@ Example:
 
 == Dependencies
 
-Rails 2.1 or later
+Rails 2.3 or later
 
 == References
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
+require 'plugin_test_helper/generator'
+
 # Generates a test console for the plugin's test application.
-class PluginTestConsoleGenerator &lt; Rails::Generator::NamedBase
+class PluginTestConsoleGenerator &lt; Rails::Generator::Base
+  include PluginTestHelper::Generator
+  
   def manifest #:nodoc:
     record do |m|
-      plugin_root = &quot;vendor/plugins/#{name}&quot;
-      
       # Script directory
       m.directory File.join(plugin_root, 'script')
       </diff>
      <filename>generators/plugin_test_console/plugin_test_console_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,9 @@
+require 'plugin_test_helper/generator'
+
 # Generates the class and view for a controller in a plugin's test application
-class PluginTestControllerGenerator &lt; PluginTestHelper::Generator
+class PluginTestControllerGenerator &lt; Rails::Generator::NamedBase
+  include PluginTestHelper::Generator
+  
   def manifest #:nodoc:
     record do |m|
       # Check for class naming collisions</diff>
      <filename>generators/plugin_test_controller/plugin_test_controller_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
+require 'plugin_test_helper/generator'
+
 # Generates the test helper for a plugin
-class PluginTestHelperGenerator &lt; Rails::Generator::NamedBase
+class PluginTestHelperGenerator &lt; Rails::Generator::Base
+  include PluginTestHelper::Generator
+  
   def manifest #:nodoc:
     record do |m|
-      plugin_root = &quot;vendor/plugins/#{name}&quot;
-      
       # Test directory
       m.directory File.join(plugin_root, 'test')
       </diff>
      <filename>generators/plugin_test_helper/plugin_test_helper_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,9 @@
+require 'plugin_test_helper/generator'
+
 # Generates migrations for a plugin's test application
-class PluginTestMigrationGenerator &lt; PluginTestHelper::Generator
+class PluginTestMigrationGenerator &lt; Rails::Generator::NamedBase
+  include PluginTestHelper::Generator
+  
   def manifest #:nodoc:
     record do |m|
       m.migration_template 'migration.rb', &quot;#{plugin_app_root}/db/migrate&quot;</diff>
      <filename>generators/plugin_test_migration/plugin_test_migration_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,26 @@
+require 'plugin_test_helper/generator'
+
 # Generates the class, fixtures, and migration for a model in a plugin's test application
-class PluginTestModelGenerator &lt; PluginTestHelper::Generator
-  default_options :skip_migration =&gt; false
+class PluginTestModelGenerator &lt; Rails::Generator::NamedBase
+  include PluginTestHelper::Generator
   
   def manifest #:nodoc:
     record do |m|
-      # Check for class naming collisions.
+      # Check for class naming collisions
       m.class_collisions class_path, class_name
       
-      # Model and fixture directories.
+      # Model and fixture directories
       m.directory File.join(plugin_app_root, 'app/models', class_path)
       m.directory File.join(plugin_test_root, 'fixtures', class_path)
       
-      # Model class and fixtures.
+      # Model class and fixtures
       m.template 'model.rb',      File.join(plugin_app_root, 'app/models', class_path, &quot;#{file_name}.rb&quot;)
       m.template 'fixtures.yml',  File.join(plugin_test_root, 'fixtures', class_path, &quot;#{table_name}.yml&quot;)
       
-      unless options[:skip_migration]
-        m.migration_template 'migration.rb', &quot;#{plugin_app_root}/db/migrate&quot;, :assigns =&gt; {
-          :migration_name =&gt; &quot;Create#{class_name.pluralize.gsub(/::/, '')}&quot;
-        }, :migration_file_name =&gt; &quot;create_#{file_path.gsub(/\//, '_').pluralize}&quot;
-      end
+      # Migration
+      m.migration_template 'migration.rb', &quot;#{plugin_app_root}/db/migrate&quot;, :assigns =&gt; {
+        :migration_name =&gt; &quot;Create#{class_name.pluralize.gsub(/::/, '')}&quot;
+      }, :migration_file_name =&gt; &quot;create_#{file_path.gsub(/\//, '_').pluralize}&quot;
     end
   end
 
@@ -27,10 +28,4 @@ class PluginTestModelGenerator &lt; PluginTestHelper::Generator
     def banner
       &quot;Usage: #{$0} generate your_plugin ModelName [field:type, field:type]&quot;
     end
-    
-    def add_options!(opt)
-      opt.separator ''
-      opt.separator 'Options:'
-      opt.on('--skip-migration',  &quot;Don't generate a migration file for this model&quot;) {|v| options[:skip_migration] = v}
-    end
 end</diff>
      <filename>generators/plugin_test_model/plugin_test_model_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,6 @@ class &lt;%= migration_name %&gt; &lt; ActiveRecord::Migration
 &lt;% for attribute in attributes -%&gt;
       t.&lt;%= attribute.type %&gt; :&lt;%= attribute.name %&gt;
 &lt;% end -%&gt;
-&lt;% unless options[:skip_timestamps] %&gt;
-      t.timestamps
-&lt;% end -%&gt;
     end
   end
 </diff>
      <filename>generators/plugin_test_model/templates/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ Examples:
 
         creates test, controller and application configurations:
             Test Helper:    test/test_helper.rb
-            Controller:     test/app_root/app/controllers/application.rb
+            Controller:     test/app_root/app/controllers/application_controller.rb
             Configurations: test/app_root/config/boot.rb
                             test/app_root/config/database.yml
                             test/app_root/config/environment.rb</diff>
      <filename>generators/plugin_test_structure/USAGE</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,13 @@
+require 'plugin_test_helper/generator'
+
 # Generates the test structure for a plugin with no dependencies on the
 # plugin_test_helper library
-class PluginTestStructureGenerator &lt; Rails::Generator::NamedBase
+class PluginTestStructureGenerator &lt; Rails::Generator::Base
+  include PluginTestHelper::Generator
+  
   def manifest #:nodoc:
     record do |m|
       # Paths are relative to our template dir
-      plugin_test_root = &quot;vendor/plugins/#{name}/test&quot;
       templates_root = &quot;#{File.dirname(__FILE__)}/templates&quot;
       
       # Root test directory</diff>
      <filename>generators/plugin_test_structure/plugin_test_structure_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -47,6 +47,7 @@ module Rails
     def load_initializer
       require &quot;#{RAILS_FRAMEWORK_ROOT}/railties/lib/initializer&quot;
       Rails::Initializer.run(:install_gem_spec_stubs)
+      Rails::GemDependency.add_frozen_gem_path
     end
   end
 
@@ -85,7 +86,7 @@ module Rails
 
       def load_rubygems
         require 'rubygems'
-        min_version = '1.1.1'
+        min_version = '1.3.1'
         unless rubygems_version &gt;= min_version
           $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
           exit 1</diff>
      <filename>generators/plugin_test_structure/templates/app_root/config/boot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,20 +2,30 @@ in_memory:
   adapter: sqlite3
   database: &quot;:memory:&quot;
   verbosity: quiet
+  pool: 5
+  timeout: 5000
 sqlite:
   adapter: sqlite
   dbfile: plugin_test.sqlite.db
+  pool: 5
+  timeout: 5000
 sqlite3:
   adapter: sqlite3
   dbfile: plugin_test.sqlite3.db
+  pool: 5
+  timeout: 5000
 postgresql:
   adapter: postgresql
   username: postgres
   password: postgres
   database: plugin_test
+  pool: 5
+  timeout: 5000
 mysql:
   adapter: mysql
   host: localhost
   username: root
   password:
   database: plugin_test
+  pool: 5
+  timeout: 5000</diff>
      <filename>generators/plugin_test_structure/templates/app_root/config/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.join(File.dirname(__FILE__), 'boot')
 Rails::Initializer.run do |config|
   config.cache_classes = false
   config.whiny_nils = true
+  config.action_controller.session = {:key =&gt; 'rails_session', :secret =&gt; 'd229e4d22437432705ab3985d4d246'}
   config.plugin_locators.unshift(
     Class.new(Rails::Plugin::Locator) do
       def plugins</diff>
      <filename>generators/plugin_test_structure/templates/app_root/config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,6 @@ ENV['RAILS_ENV'] ||= 'in_memory'
 # Load the Rails environment and testing framework
 require &quot;#{File.dirname(__FILE__)}/app_root/config/environment&quot;
 require 'test_help'
-require 'action_view/test_case' # Load additional test classes not done automatically by &lt; Rails 2.2.2
 
 # Undo changes to RAILS_ENV
 silence_warnings {RAILS_ENV = ENV['RAILS_ENV']}
@@ -13,8 +12,10 @@ silence_warnings {RAILS_ENV = ENV['RAILS_ENV']}
 ActiveRecord::Migrator.migrate(&quot;#{Rails.root}/db/migrate&quot;)
 
 # Set default fixture loading properties
-Test::Unit::TestCase.class_eval do
+ActiveSupport::TestCase.class_eval do
   self.use_transactional_fixtures = true
   self.use_instantiated_fixtures = false
   self.fixture_path = &quot;#{File.dirname(__FILE__)}/fixtures&quot;
+  
+  fixtures :all
 end</diff>
      <filename>generators/plugin_test_structure/templates/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,16 +19,14 @@ require 'plugin_test_helper/extensions/initializer'
 require 'config/environment'
 require 'test_help'
 
-# Load additional test classes not done automatically by &lt; Rails 2.2.2
-# TODO: Remove in Rails 2.2.3 / 2.3 (whichever includes the fix)
-require 'action_view/test_case'
-
 # Undo changes to RAILS_ENV
 silence_warnings {RAILS_ENV = ENV['RAILS_ENV']}
 
 # Set default fixture loading properties
-Test::Unit::TestCase.class_eval do
+ActiveSupport::TestCase.class_eval do
   self.use_transactional_fixtures = true
   self.use_instantiated_fixtures = false
-  self.fixture_path = &quot;#{Rails.root}/../fixtures&quot;
+  self.fixture_path = &quot;#{File.dirname(__FILE__)}/fixtures&quot;
+  
+  fixtures :all
 end</diff>
      <filename>lib/plugin_test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,6 @@ module PluginTestHelper
         alias_method_chain base, :default_routes_configuration_file, :test_helper
         alias_method_chain base, :default_controller_paths, :test_helper
         alias_method_chain base, :default_plugin_locators, :test_helper
-        alias_method_chain base, :default_plugin_paths, :test_helper
       end
       
       # Defines a &quot;lite&quot; version of ActiveSupport's alias chaining extensions.
@@ -60,7 +59,6 @@ module PluginTestHelper
             app/controllers
             config
             lib
-            vendor
           ).map {|dir| &quot;#{HELPER_RAILS_ROOT}/#{dir}&quot;}
         end
         
@@ -87,12 +85,6 @@ module PluginTestHelper
           locators = default_plugin_locators_without_test_helper
           locators.unshift(PluginTestHelper::PluginLocator)
         end
-        
-        # Add the helper's vendor/plugins path
-        def default_plugin_paths_with_test_helper
-          paths = default_plugin_paths_without_test_helper
-          paths &lt;&lt; File.join(HELPER_RAILS_ROOT, 'vendor/plugins')
-        end
     end
   end
 end</diff>
      <filename>lib/plugin_test_helper/extensions/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ 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 &lt; Rails::Generator::NamedBase
+  module Generator
     attr_accessor :plugin_name
     
     def initialize(*runtime_args) #:nodoc:
@@ -12,9 +12,14 @@ module PluginTestHelper
     end
     
     private
+      # The root path of the plugin's directory
+      def plugin_root
+        &quot;vendor/plugins/#{plugin_name}&quot;
+      end
+      
       # The root path of the plugin's test directory
       def plugin_test_root
-        &quot;vendor/plugins/#{plugin_name}/test&quot;
+        &quot;#{plugin_root}/test&quot;
       end
       
       # The root path of the plugin's test app</diff>
      <filename>lib/plugin_test_helper/generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@ class PluginTestHelperTest &lt; Test::Unit::TestCase
   
   def test_should_load_with_no_app_root
     load 'plugin_test_helper.rb'
+    
     assert_valid_environment
   end
   </diff>
      <filename>test/functional/plugin_test_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ class PluginTestStructureGeneratorTest &lt; Test::Unit::TestCase
   end
   
   def test_should_create_application_controller
-    assert File.exists?(&quot;#{Rails.root}/vendor/plugins/acts_as_foo/test/app_root/app/controllers/application.rb&quot;)
+    assert File.exists?(&quot;#{Rails.root}/vendor/plugins/acts_as_foo/test/app_root/app/controllers/application_controller.rb&quot;)
   end
   
   def test_should_create_in_memory_environment</diff>
      <filename>test/functional/plugin_test_structure_generator_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,25 @@ require 'stringio'
 Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(StringIO.new))
 
 Test::Unit::TestCase.class_eval do
+  def self.reset_environment
+    # Clear dependencies
+    ActiveRecord::Base.reset_subclasses
+    ActiveSupport::Dependencies.clear
+    
+    # Clear configurations
+    ActionController::Routing.controller_paths.clear
+    ActionController::Routing::Routes.configuration_files.clear
+    Rails::Rack::Metal.requested_metals.clear if Rails::Rack::Metal.requested_metals
+    Rails::Rack::Metal.metal_paths.clear if Rails::Rack::Metal.metal_paths
+    
+    # Reset open streams
+    ActiveRecord::Base.clear_reloadable_connections!
+    
+    # Forget that the environment files were loaded so that a new app environment
+    # can be set up again
+    $&quot;.delete_if {|path| path =~ /(config\/environment\.rb|test_help\.rb)$/}
+  end
+  
   private
     def assert_valid_environment
       assert_not_nil ApplicationController
@@ -29,19 +48,14 @@ Test::Unit::TestCase.class_eval do
     end
     
     def teardown_app
-      # Clear dependencies
-      self.class.use_transactional_fixtures = false
-      ActiveRecord::Base.reset_subclasses
-      ActiveSupport::Dependencies.clear
-      
-      # Reset open streams
-      ActiveRecord::Base.clear_reloadable_connections!
-      
-      # Forget that the environment files were loaded so that a new app environment
-      # can be set up again
-      $&quot;.delete_if {|path| path =~ /(config\/environment\.rb|test_help\.rb)$/}
+      self.class.reset_environment
       
       # Remove the app folder
       FileUtils.rm_r(Dir['test/app_root/*'])
     end
 end
+
+# Load the helper once before tests start so that the Rails library paths
+# don't get lost betweeen environment loads
+require 'plugin_test_helper'
+Test::Unit::TestCase.reset_environment</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>generators/plugin_test_structure/templates/app_root/app/controllers/application.rb</filename>
    </removed>
    <removed>
      <filename>test/app_roots/with_custom_application_controller/app/controllers/application.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>13aa3f25c0a473ea3323f72c60ddfa0ea87be763</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </author>
  <url>http://github.com/pluginaweek/plugin_test_helper/commit/4008a7848522c9d7b02059373a96d7c83a91374d</url>
  <id>4008a7848522c9d7b02059373a96d7c83a91374d</id>
  <committed-date>2009-04-12T12:45:38-07:00</committed-date>
  <authored-date>2009-04-12T12:45:38-07:00</authored-date>
  <message>Add dependency on Rails 2.3
Rename application.rb to application_controller.rb
Clean up / simplify generators
Fix environment being loaded twice when generators are loaded</message>
  <tree>948f48428d98cbd145335eb02c96d7443fa9626b</tree>
  <committer>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </committer>
</commit>
