diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-26 10:44:53 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-26 10:44:53 +0100 |
commit | 5893baa683e9b3c85c07d2811656be03765ebad7 (patch) | |
tree | e4073ced072dcd9893431371172216a7bed7d73f /railties | |
parent | b48beb6986ee3c533ccae6d54d70f3c28a80a942 (diff) | |
download | rails-5893baa683e9b3c85c07d2811656be03765ebad7.tar.gz rails-5893baa683e9b3c85c07d2811656be03765ebad7.tar.bz2 rails-5893baa683e9b3c85c07d2811656be03765ebad7.zip |
Add autoload to generators modules and fix failing test.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators.rb | 8 | ||||
-rw-r--r-- | railties/test/generators_test.rb | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index f24dc620de..3c902ce0d4 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -10,10 +10,16 @@ require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/string/inflections' require 'rails/generators/base' -require 'rails/generators/named_base' module Rails module Generators + autoload :Actions, 'rails/generators/actions' + autoload :ActiveModel, 'rails/generators/active_model' + autoload :Migration, 'rails/generators/migration' + autoload :NamedBase, 'rails/generators/named_base' + autoload :ResourceHelpers, 'rails/generators/resource_helpers' + autoload :TestCase, 'rails/generators/test_case' + DEFAULT_ALIASES = { :rails => { :actions => '-a', diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 07bc92c55c..dd17f8f756 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -145,17 +145,17 @@ class GeneratorsTest < Rails::Generators::TestCase end def test_developer_options_are_overwriten_by_user_options - Rails::Generators.options[:new_generator] = { :generate => false } + Rails::Generators.options[:with_options] = { :generate => false } self.class.class_eval <<-end_eval - class NewGenerator < Rails::Generators::Base + class WithOptionsGenerator < Rails::Generators::Base class_option :generate, :default => true end end_eval - assert_equal false, NewGenerator.class_options[:generate].default + assert_equal false, WithOptionsGenerator.class_options[:generate].default ensure - Rails::Generators.subclasses.delete(NewGenerator) + Rails::Generators.subclasses.delete(WithOptionsGenerator) end def test_load_generators_from_railties |