Plugins need to load before app initializers

This commit is contained in:
Joshua Peek 2010-01-25 11:06:39 -06:00
parent 3b6f659fb6
commit 2d1f9fb98f
2 changed files with 14 additions and 1 deletions

View File

@ -91,8 +91,8 @@ module Rails
def initializers
initializers = Bootstrap.initializers
initializers += super
railties.all { |r| initializers += r.initializers }
initializers += super
initializers += Finisher.initializers
initializers
end

View File

@ -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