Sha256: 222fdeabc96e3793a01272113aebbc5340ae575f4a85d4b4617eb988d4f7304b

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path 'test_helper', File.dirname(__FILE__)

class TestSkypeChat < MiniTest::Test

  SKYPE_FROM = ENV["SKYPE_FROM"]
  SKYPE_TO   = ENV["SKYPE_TO"] || "echo123"

  def test_exec
    body = "hello exec"
    msg = Skype.exec "MESSAGE #{SKYPE_TO} #{body}"
    assert_equal msg.body, body
    assert_equal msg.time.class, Time
    assert_equal msg.user, SKYPE_FROM
  end

  def test_message
    body = "hello hello"
    msg = Skype.message SKYPE_TO, body
    assert_equal msg.body, body
    assert_equal msg.time.class, Time
    assert_equal msg.user, SKYPE_FROM
  end

  def test_message_escape
    body = "hello \"'$@&()^![]{};*?<>`\\ world"
    msg = Skype.message SKYPE_TO, body
    assert_equal msg.body, body
    assert_equal msg.time.class, Time
    assert_equal msg.user, SKYPE_FROM
  end

  def test_chats
    chat = Skype.chats[0]
    assert_equal chat.class, Skype::Chat
    assert_equal chat.topic.class, String
    assert_equal chat.members.class, Array
    assert_equal !chat.members.empty?, true
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
skype-0.2.8 test/test_chat.rb
skype-0.2.7 test/test_chat.rb
skype-0.2.6 test/test_chat.rb
skype-0.2.5 test/test_chat.rb
skype-0.2.4 test/test_chat.rb
skype-0.2.3 test/test_chat.rb
skype-0.2.2 test/test_chat.rb
skype-0.2.1 test/test_chat.rb
skype-0.2.0 test/test_chat.rb