From 5c41cb77d9af28fe6495d5c4047483ce3ceadfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 23 Mar 2010 23:50:24 +0100 Subject: Ensure lib/rails/initializers/*.rb also works for gems. --- railties/test/railties/plugin_test.rb | 20 -------------------- railties/test/railties/shared_tests.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 20 deletions(-) (limited to 'railties/test') diff --git a/railties/test/railties/plugin_test.rb b/railties/test/railties/plugin_test.rb index 4ea5460a68..6081890fcb 100644 --- a/railties/test/railties/plugin_test.rb +++ b/railties/test/railties/plugin_test.rb @@ -94,26 +94,6 @@ module RailtiesTest assert rescued, "Expected boot rails to fail" end - test "loads lib/rails/initializers/foo.rb" do - @plugin.write "lib/rails/initializers/foo.rb", <<-RUBY - $loaded = true - RUBY - - boot_rails - assert $loaded - end - - test "loads vendored rails/initializers/foo thats already in the $LOAD_PATH" do - $: << "#{app_path}/vendor/foo/lib" - - app_file "vendor/foo/lib/rails/initializers/foo.rb", <<-RUBY - $loaded = true - RUBY - - boot_rails - assert $loaded - end - test "skips init.rb if initializer is present" do @plugin.write "lib/rails/initializers/foo.rb", <<-RUBY $loaded = true diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 83d25be5db..48539c2e99 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -297,6 +297,16 @@ YAML assert $plugin_initializer end + def test_rails_plugin_initializers + $plugin_initializer = false + @plugin.write "lib/rails/initializers/foo.rb", <<-RUBY + $plugin_initializer = true + RUBY + + boot_rails + assert $plugin_initializer + end + def test_plugin_midleware_referenced_in_configuration @plugin.write "lib/bukkits.rb", <<-RUBY class Bukkits -- cgit v1.2.3