Permalink
Browse files

Ruby 1.9.2: work around inherited hook being called before yielding t…

…o block
  • Loading branch information...
1 parent 7a68554 commit a66449d85255fc3ec69aa842b8059f954d7b76e2 @jeremy jeremy committed Nov 9, 2009
Showing with 5 additions and 7 deletions.
  1. +5 −7 railties/test/generators_test.rb
@@ -165,15 +165,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"
+ self.class.class_eval <<-end_eval
+ class NewGenerator < Rails::Generators::Base
+ class_option :generate, :default => true
end
+ end_eval
- class_option :generate, :default => true
- end
-
- assert_equal false, klass.class_options[:generate].default
+ assert_equal false, NewGenerator.class_options[:generate].default
end
def test_source_paths_for_not_namespaced_generators

0 comments on commit a66449d

Please sign in to comment.