1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix test on 1.8.8. Broken by inherited hook now running before Class.new block.

This commit is contained in:
Jeremy Kemper 2010-02-25 10:46:29 -08:00
parent 45ceacd6de
commit c7f9e8c06c

View file

@ -147,12 +147,13 @@ class GeneratorsTest < Rails::Generators::TestCase
def test_developer_options_are_overwriten_by_user_options
Rails::Generators.options[:new_generator] = { :generate => false }
klass = Class.new(Rails::Generators::Base) do
def self.name() 'NewGenerator' end
self.class.class_eval <<-end_eval
class NewGenerator < Rails::Generators::Base
class_option :generate, :default => true
end
end_eval
assert_equal false, klass.class_options[:generate].default
assert_equal false, NewGenerator.class_options[:generate].default
ensure
Rails::Generators.subclasses.delete(klass)
end