File: tc_client.rb

package info (click to toggle)
ruby-xmpp4r 0.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,384 kB
  • sloc: ruby: 17,382; xml: 74; sh: 12; makefile: 4
file content (30 lines) | stat: -rwxr-xr-x 670 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/ruby

$:.unshift '../lib'

require 'test/unit'
require 'xmpp4r/client'
include Jabber

class ClientTest < Test::Unit::TestCase
  def test_client1
=begin
    c = Client.new(JID.new('client1@localhost/res'))
    assert_nothing_raised("Couldn't connect") {
      c.connect
    }
    assert_nothing_raised("Couldn't authenticate") {
      c.auth('pw')
    }
=end
  end

  def test_jid_is_jid
    c1 = Client.new(JID.new('user@host/resource'))
    assert_kind_of(JID, c1.jid)
    assert_equal('user@host/resource', c1.jid.to_s)
    c2 = Client.new('user@host/resource')
    assert_kind_of(JID, c2.jid)
    assert_equal('user@host/resource', c2.jid.to_s)
  end
end