diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-27 13:31:36 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-27 13:31:36 +0100 |
commit | 7e8b7f46bfc086a36db996420fbee93348c5268e (patch) | |
tree | 7c4e309b378ce6a3d39c60785efc603619e25ac8 /railties/test | |
parent | 75ba102a80965b2612df0253d1278581a88b8d66 (diff) | |
download | rails-7e8b7f46bfc086a36db996420fbee93348c5268e.tar.gz rails-7e8b7f46bfc086a36db996420fbee93348c5268e.tar.bz2 rails-7e8b7f46bfc086a36db996420fbee93348c5268e.zip |
Add config.action_controller.include behavior to plugins.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/plugins/configuration_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/plugins/configuration_test.rb b/railties/test/plugins/configuration_test.rb index 5786316d1d..0843d05577 100644 --- a/railties/test/plugins/configuration_test.rb +++ b/railties/test/plugins/configuration_test.rb @@ -8,6 +8,10 @@ module PluginsTest require "rails" end + module Bar; end + module Baz; end + module All; end + test "config is available to plugins" do class Foo < Rails::Plugin ; end assert_nil Foo.config.action_controller.foo @@ -24,6 +28,18 @@ module PluginsTest assert_equal "hello", AppTemplate::Application.config.foo.greetings end + test "plugin configurations allow modules to be given" do + class Foo < Rails::Plugin ; config.foo.include(Bar, Baz) ; end + assert_equal [Bar, Baz], Foo.config.foo.includes + end + + test "plugin includes given modules in given class" do + class Foo < Rails::Plugin ; config.foo.include(Bar, "PluginsTest::ConfigurationTest::Baz") ; include_modules_in All ; end + Foo.new.run_initializers(Foo) + assert All.ancestors.include?(Bar) + assert All.ancestors.include?(Baz) + end + test "plugin config merges are deep" do class Foo < Rails::Plugin ; config.foo.greetings = 'hello' ; end class MyApp < Rails::Application |