]> source.dussan.org Git - redmine.git/commitdiff
Don't clear plugins in tests (#16258).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 21 Mar 2014 01:12:11 +0000 (01:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 21 Mar 2014 01:12:11 +0000 (01:12 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12988 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb
test/functional/settings_controller_test.rb

index 9f2862c53159405c35e5426d9d67c772a8c94232..f2800d211e006a3f4607fb21fe7af4881ca2243f 100644 (file)
@@ -113,6 +113,12 @@ module Redmine #:nodoc:
       @registered_plugins = {}
     end
 
+    # Removes a plugin from the registered plugins
+    # It doesn't unload the plugin
+    def self.unregister(id)
+      @registered_plugins.delete(id)
+    end
+
     # Checks if a plugin is installed
     #
     # @param [String] id name of the plugin
index fc64f87dcc05997a98338bc3e13cbb37d0e13ba8..80d3123a0afbc99b6fb7017199ff19faeaf73ba6 100644 (file)
@@ -148,7 +148,8 @@ class SettingsControllerTest < ActionController::TestCase
     assert_tag 'form', :attributes => {:action => '/settings/plugin/foo'},
       :descendant => {:tag => 'input', :attributes => {:name => 'settings[sample_setting]', :value => 'Plugin setting value'}}
 
-    Redmine::Plugin.clear
+  ensure
+    Redmine::Plugin.unregister(:foo)
   end
 
   def test_get_invalid_plugin_settings
@@ -162,7 +163,8 @@ class SettingsControllerTest < ActionController::TestCase
     get :plugin, :id => 'foo'
     assert_response 404
 
-    Redmine::Plugin.clear
+  ensure
+    Redmine::Plugin.unregister(:foo)
   end
 
   def test_post_plugin_settings
@@ -181,6 +183,7 @@ class SettingsControllerTest < ActionController::TestCase
     post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'}
     assert_response 404
 
-    Redmine::Plugin.clear
+  ensure
+    Redmine::Plugin.unregister(:foo)
   end
 end