Sha256: f9722cd3b83ff00ba59d7c296362bc2608e1591ce1eba5c433991d92a9541ead

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require 'test_helper'

class Robut::PluginTest < Test::Unit::TestCase

  class HandrolledStubPlugin
    include Robut::Plugin
  end

  def setup
    @plugin = HandrolledStubPlugin.new(Robut::ConnectionMock.new)
  end

  def test_sent_to_me?
    assert @plugin.sent_to_me?("@Robut hello there")
    assert !@plugin.sent_to_me?("@Robuto hello there")
    assert !@plugin.sent_to_me?("@David hello there")
    assert @plugin.sent_to_me?("this is a @Robut message")
    assert @plugin.sent_to_me?("this is a message to @robut")
    assert !@plugin.sent_to_me?("this is a message to@robut")
  end

  def test_without_nick_robut_do_this
    assert_equal "do this", @plugin.without_nick("@robut do this")
  end

  def test_without_nick_do_this_robut
    assert_equal "do this @robut", @plugin.without_nick("do this @robut")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
robut-0.3.0 test/unit/plugin_test.rb