test/unit/plugin/help_test.rb in robut-0.3.0 vs test/unit/plugin/help_test.rb in robut-0.4.0
- old
+ new
@@ -12,13 +12,14 @@
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(@connection)
+ @plugin = Robut::Plugin::Help.new(@presence)
end
def teardown
Robut::Plugin.plugins = []
end
@@ -27,19 +28,19 @@
@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.connection.replies
+ ], @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.connection.replies
+ ], @plugin.reply_to.replies
end
end