Class: ClientTest

Inherits:
Test::Unit::TestCase show all
Defined in:
lib/gems/xmpp4r-0.4/test/tc_client.rb

Instance Method Summary collapse

Methods inherited from Test::Unit::TestCase

#assert_array_equal, expect, #run

Instance Method Details

#test_client1Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gems/xmpp4r-0.4/test/tc_client.rb', line 10

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

#test_jid_is_jidObject



22
23
24
25
26
27
28
29
# File 'lib/gems/xmpp4r-0.4/test/tc_client.rb', line 22

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