diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators_test.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 33cc27bd84..844497c8e3 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -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 - class_option :generate, :default => true - 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 |