Sha256: 6920b75a54cda920084b1b10aad491e7ba56fb3d9632b5f68ab2303f0f9ef1ed
Contents?: true
Size: 1.14 KB
Versions: 11
Compression:
Stored size: 1.14 KB
Contents
require 'test_helper' require 'robut/plugin/echo' require 'robut/plugin/help' class Robut::Plugin::PluginWithoutHelp include Robut::Plugin def usage super end end class Robut::Plugin::HelpTest < Test::Unit::TestCase def setup @connection = Robut::ConnectionMock.new @presence = Robut::PresenceMock.new(@connection) Robut::Plugin.plugins << Robut::Plugin::Echo Robut::Plugin.plugins << Robut::Plugin::Help @plugin = Robut::Plugin::Help.new(@presence) end def teardown Robut::Plugin.plugins = [] end def test_help @plugin.handle(Time.now, "@justin", "@robut help") assert_equal [ "Supported commands:", "@robut echo <message> - replies to the channel with <message>", "@robut help - displays this message", ], @plugin.reply_to.replies end def test_empty_help Robut::Plugin.plugins << Robut::Plugin::PluginWithoutHelp @plugin.handle(Time.now, "@justin", "@robut help") assert_equal [ "Supported commands:", "@robut echo <message> - replies to the channel with <message>", "@robut help - displays this message", ], @plugin.reply_to.replies end end
Version data entries
11 entries across 11 versions & 2 rubygems