Skip to content

Commit

Permalink
Ruby 1.9.2: work around inherited hook being called before yielding t…
Browse files Browse the repository at this point in the history
…o block
  • Loading branch information
jeremy committed Nov 9, 2009
1 parent 7a68554 commit a66449d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions railties/test/generators_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit a66449d

Please sign in to comment.