From fcfcc707d4ae94441496d36e78a598914df3cebc Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Thu, 8 Nov 2007 15:41:46 +0000 Subject: Ensure the plugin loader only loads plugins once. Closes #10102 [haruki_zaemon] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/test/plugin_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'railties/test') diff --git a/railties/test/plugin_test.rb b/railties/test/plugin_test.rb index a791e42ae8..0f08c314db 100644 --- a/railties/test/plugin_test.rb +++ b/railties/test/plugin_test.rb @@ -119,6 +119,17 @@ uses_mocha "Plugin Tests" do z = plugin_for("path/z") assert_equal [a, b, z], [b, z, a].sort end + + def test_should_only_be_loaded_once + plugin = plugin_for(@valid_plugin_path) + assert !plugin.loaded? + plugin.expects(:evaluate_init_rb) + assert_nothing_raised do + plugin.send(:load, @initializer) + plugin.send(:load, @initializer) + end + assert plugin.loaded? + end private -- cgit v1.2.3