summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2008-07-28 17:30:32 -0700
committerEric Davis <edavis@littlestreamsoftware.com>2008-07-28 17:30:32 -0700
commit99ea01ec936aaa9bfc131435fad1834900547f58 (patch)
treebaf2d45cee5b22914323bcd9f06428d39187c1ee
parente87140a719c216cabe91ed9b27af8b93ec50aa86 (diff)
downloadredmine-plugin-hooks.tar.gz
redmine-plugin-hooks.zip
Added test coverage for Redmine::Plugin.add_hookplugin-hooks
-rw-r--r--test/unit/lib/redmine/plugin_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/plugin_test.rb b/test/unit/lib/redmine/plugin_test.rb
index c7d792475..22d90ae3a 100644
--- a/test/unit/lib/redmine/plugin_test.rb
+++ b/test/unit/lib/redmine/plugin_test.rb
@@ -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