test/unit/plugin/echo_test.rb in robut-0.3.0 vs test/unit/plugin/echo_test.rb in robut-0.4.0
- old
+ new
@@ -3,24 +3,25 @@
class Robut::Plugin::EchoTest < Test::Unit::TestCase
def setup
@connection = Robut::ConnectionMock.new
- @plugin = Robut::Plugin::Echo.new(@connection)
+ @presence = Robut::PresenceMock.new(@connection)
+ @plugin = Robut::Plugin::Echo.new(@presence)
end
def test_replies_with_this
@plugin.handle(Time.now, "@john", "@robut echo this")
- assert_equal ["this"], @plugin.connection.replies
+ assert_equal ["this"], @plugin.reply_to.replies
end
def test_replies_with_nicks
@plugin.handle(Time.now, "@john", "@robut echo @justin look over here!")
- assert_equal ["@justin look over here!"], @plugin.connection.replies
+ assert_equal ["@justin look over here!"], @plugin.reply_to.replies
end
def test_doesnt_reply_with_empty
@plugin.handle(Time.now, "@john", "@robut echo")
- assert_equal [], @plugin.connection.replies
+ assert_equal [], @plugin.reply_to.replies
end
end