Sha256: 3d4340d60cd5ed7f90508580d24a196e3264089a18fec589b704ade4ffc2f1fd

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

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

class TestSkype < 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

2 entries across 2 versions & 1 rubygems

Version Path
skype-0.1.5 test/test_chat.rb
skype-0.1.4 test/test_chat.rb