diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-28 18:00:52 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-11-02 17:14:52 +0100 |
commit | cfbe5958311f21397c98657c3370d03dcf720fe1 (patch) | |
tree | 46d125f939518cc8fdd1788acf3a5f043602fdb6 /railties | |
parent | 9e86767bb88f45db0f9aef42b1bea1177cba8e53 (diff) | |
download | rails-cfbe5958311f21397c98657c3370d03dcf720fe1.tar.gz rails-cfbe5958311f21397c98657c3370d03dcf720fe1.tar.bz2 rails-cfbe5958311f21397c98657c3370d03dcf720fe1.zip |
Use application's generators defaults as engine defaults to not force users to manually set it
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 1 | ||||
-rw-r--r-- | railties/test/railties/engine_test.rb | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index 7a07dcad7d..5607628d96 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -10,6 +10,7 @@ module Rails def initialize(root=nil) super() @root = root + @generators = app_generators end # Returns the middleware stack for the engine. diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 4b52260ecc..3509f964eb 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -685,5 +685,22 @@ module RailtiesTest assert_equal :haml , generators[:template_engine] assert_equal :rspec , generators[:test_framework] end + + test "engine should get default generators with ability to overwrite them" do + @plugin.write "lib/bukkits.rb", <<-RUBY + module Bukkits + class Engine < ::Rails::Engine + config.generators.test_framework :rspec + end + end + RUBY + + boot_rails + require "#{rails_root}/config/environment" + + generators = Bukkits::Engine.config.generators.options[:rails] + assert_equal :active_record, generators[:orm] + assert_equal :rspec , generators[:test_framework] + end end end |