Permalink
Browse files

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

…new block.
  • Loading branch information...
1 parent 45ceacd commit c7f9e8c06cb60aef33cf0a03cb3c1b927eb8c1cf @jeremy jeremy committed Feb 25, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −5 railties/test/generators_test.rb
@@ -147,12 +147,13 @@ def test_nested_fallbacks_for_generators
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

0 comments on commit c7f9e8c

Please sign in to comment.