252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
# File 'lib/vendor/xmpp4r/test/muc/tc_muc_mucclient.rb', line 252
def test_custom_exit_message
state { |pres|
assert_kind_of(Presence, pres)
assert_nil(pres.type)
send("<presence from='[email protected]/thirdwitch' to='[email protected]/pda'>" +
"<x xmlns='http://jabber.org/protocol/muc#user'><item affiliation='member' role='participant'/></x>" +
"</presence>")
}
state { |pres|
assert_kind_of(Presence, pres)
assert_equal(:unavailable, pres.type)
assert_equal(JID.new('[email protected]/pda'), pres.from)
assert_equal('gone where the goblins go', pres.status)
send("<presence from='[email protected]/thirdwitch' to='[email protected]/pda' type='unavailable'>" +
"<x xmlns='http://jabber.org/protocol/muc#user'><item affiliation='member' role='none'/></x>" +
"</presence>")
}
m = MUC::MUCClient.new(@client)
m.my_jid = '[email protected]/pda'
assert_equal(m, m.join('[email protected]/thirdwitch'))
assert(m.active?)
wait_state
assert_equal(m, m.exit('gone where the goblins go'))
assert(!m.active?)
wait_state
end
|