diff options
author | Matthias Hecker <mail@apoc.cc> | 2020-03-31 14:33:48 +0200 |
---|---|---|
committer | Matthias Hecker <mail@apoc.cc> | 2020-03-31 14:33:48 +0200 |
commit | 201901b959ad7f8b6d30f2867ee06c213c093e4b (patch) | |
tree | d496dba0e3efa810c879ec41a1ed030a6d452049 | |
parent | f092b7db45e01b459aa899e8c0d076b97c137c16 (diff) |
test: rot13 simplified
-rw-r--r-- | test/plugins/test_rot13.rb | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/test/plugins/test_rot13.rb b/test/plugins/test_rot13.rb index 77e6fbda..a8223532 100644 --- a/test/plugins/test_rot13.rb +++ b/test/plugins/test_rot13.rb @@ -30,29 +30,21 @@ class MockBot end def registry_factory - Irc::Bot::Registry.new('dbm') + Irc::Bot::Registry.new('tc') end end class PluginTest < Test::Unit::TestCase def setup - Irc::Bot::Plugins.manager.bot_associate(MockBot.new) - - # @plugin = RotPlugin.new(MockBot.new) - # require '' - plugin_module = Module.new - fname = './data/rbot/plugins/rot13.rb' - bindtextdomain_to(plugin_module, "rbot-#{File.basename(fname, '.rb')}") - plugin_string = IO.read(fname) - plugin_module.module_eval(plugin_string, fname) + manager = Irc::Bot::Plugins.manager + manager.bot_associate(MockBot.new) + manager.load_botmodule_file('./data/rbot/plugins/rot13.rb') + @plugin = manager.get_plugin('rot') end def test_rot13 - plugins = Irc::Bot::Plugins.manager.botmodules[:Plugin] - assert_equal(plugins.size, 1) - rot13 = plugins.first - - assert_equal(rot13.help(nil), "rot13 <string> => encode <string> to rot13 or back") + assert_not_nil(@plugin) + assert_equal(@plugin.help(nil), "rot13 <string> => encode <string> to rot13 or back") end end |