Sha256: 1f42f26e2b0362a54a1f52d7cba200876f65e321881cded3cb2097bc892ac920

Contents?: true

Size: 709 Bytes

Versions: 3

Compression:

Stored size: 709 Bytes

Contents

require 'test_helper'
require 'robut/plugin/echo'

class Robut::Plugin::EchoTest < Test::Unit::TestCase

  def setup
    @connection = Robut::ConnectionMock.new
    @plugin = Robut::Plugin::Echo.new(@connection)
  end

  def test_replies_with_this
    @plugin.handle(Time.now, "@john", "@robut echo this")
    assert_equal ["this"], @plugin.connection.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
  end
  
  def test_doesnt_reply_with_empty
    @plugin.handle(Time.now, "@john", "@robut echo")
    assert_equal [], @plugin.connection.replies    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
robut-0.3.0 test/unit/plugin/echo_test.rb
robut-0.2.1 test/unit/plugin/echo_test.rb
robut-0.2.0 test/unit/plugin/echo_test.rb