From 2d1f9fb98f6b4f7afa469eba57eac4041c8ee539 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 25 Jan 2010 11:06:39 -0600 Subject: Plugins need to load before app initializers --- railties/test/plugins/vendored_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'railties/test') diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb index 05c01846e1..3977099184 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/plugins/vendored_test.rb @@ -37,6 +37,19 @@ module PluginsTest assert_equal "Bukkits", Bukkits.name end + test "plugin init is ran before application initializers" do + plugin "foo", "$foo = true" do |plugin| + plugin.write "lib/foo.rb", "module Foo; end" + end + + app_file 'config/initializers/foo.rb', <<-RUBY + raise "no $foo" unless $foo + raise "no Foo" unless Foo + RUBY + + boot_rails + end + test "plugin paths get added to the AS::Dependency list" do boot_rails assert_equal "Bukkits", Bukkits.name -- cgit v1.2.3