Navigation Menu

Skip to content

Commit

Permalink
Add test to unregister plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Apr 2, 2015
1 parent 588ff73 commit 5058dee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test-plugin.rb
Expand Up @@ -34,4 +34,22 @@ def test_system_plugins_dir
File.exist?(plugin_path)
end
end

class UnregisterTest < self
def test_by_name
context = Groonga::Context.default
context.register_plugin("token_filters/stop_word")
context.unregister_plugin("token_filters/stop_word")
assert_nil(context["TokenFilterStopWord"])
end

def test_by_path
context = Groonga::Context.default
plugin_path = "#{Groonga::Plugin.system_plugins_dir}/"
plugin_path << "token_filters/stop_word#{Groonga::Plugin.suffix}"
context.register_plugin(plugin_path)
context.unregister_plugin(plugin_path)
assert_nil(context["TokenFilterStopWord"])
end
end
end

0 comments on commit 5058dee

Please sign in to comment.