]> source.dussan.org Git - redmine.git/commitdiff
Added test coverage for Redmine::Plugin.add_hook plugin-hooks
authorEric Davis <edavis@littlestreamsoftware.com>
Tue, 29 Jul 2008 00:30:32 +0000 (17:30 -0700)
committerEric Davis <edavis@littlestreamsoftware.com>
Tue, 29 Jul 2008 00:30:32 +0000 (17:30 -0700)
test/unit/lib/redmine/plugin_test.rb

index c7d792475d508b6619ad707837a8dc639b94973a..22d90ae3a319b6922b51d460dc7e3ade8af1f4c5 100644 (file)
@@ -4,5 +4,17 @@ class Redmine::PluginTest < Test::Unit::TestCase
   def test_sanity
     assert true
   end
+  
+  def test_add_hook
+    assert_equal false, Redmine::Plugin::Hook::Manager.hook_registered?(:issue_show)
+    Redmine::Plugin.add_hook(:issue_show, Proc.new { })
+    assert Redmine::Plugin::Hook::Manager.hook_registered?(:issue_show)
+  end
+  
+  def test_add_hook_invalid
+    assert_equal false, Redmine::Plugin::Hook::Manager.hook_registered?(:invalid)
+    Redmine::Plugin.add_hook(:invalid, Proc.new { })
+    assert Redmine::Plugin::Hook::Manager.hook_registered?(:invalid)
+  end
 end