diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-03-12 16:00:01 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-03-12 16:00:01 +0000 |
commit | e68bfaf1fe1a7890a67af6f444281185f507cf9e (patch) | |
tree | 5e73caccdcdd65d0ac97f9eb92195928f30925f2 /railties/test/generators_test.rb | |
parent | ef6462c73003b28c8e060a06120abb9cd67b6d52 (diff) | |
parent | 16846553b8866eab2aa3b128a2a23a221a25f7e3 (diff) | |
download | rails-e68bfaf1fe1a7890a67af6f444281185f507cf9e.tar.gz rails-e68bfaf1fe1a7890a67af6f444281185f507cf9e.tar.bz2 rails-e68bfaf1fe1a7890a67af6f444281185f507cf9e.zip |
Merge remote branch 'mainstream/master'
Conflicts:
activerecord/lib/active_record/base.rb
railties/lib/rails/configuration.rb
railties/lib/rails/log_subscriber.rb
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r-- | railties/test/generators_test.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 33cc27bd84..dd17f8f756 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -145,16 +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 } - klass = Class.new(Rails::Generators::Base) do - def self.name() 'NewGenerator' end - class_option :generate, :default => true - end + self.class.class_eval <<-end_eval + class WithOptionsGenerator < Rails::Generators::Base + class_option :generate, :default => true + end + end_eval - assert_equal false, klass.class_options[:generate].default + assert_equal false, WithOptionsGenerator.class_options[:generate].default ensure - Rails::Generators.subclasses.delete(klass) + Rails::Generators.subclasses.delete(WithOptionsGenerator) end def test_load_generators_from_railties |