Class: XDelayTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- XDelayTest
- Defined in:
- lib/vendor/xmpp4r/test/delay/tc_xdelay.rb
Instance Method Summary collapse
- #test_create1 ⇒ Object
- #test_create2 ⇒ Object
- #test_from ⇒ Object
- #test_import ⇒ Object
- #test_stamp ⇒ Object
Instance Method Details
#test_create1 ⇒ Object
11 12 13 14 15 16 |
# File 'lib/vendor/xmpp4r/test/delay/tc_xdelay.rb', line 11 def test_create1 d = Delay::XDelay.new(false) assert_equal(nil, d.stamp) assert_equal(nil, d.from) assert_equal('jabber:x:delay', d.namespace) end |
#test_create2 ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/vendor/xmpp4r/test/delay/tc_xdelay.rb', line 18 def test_create2 d = Delay::XDelay.new # Hopefully the seconds don't change here... assert_equal(Time.now.to_s, d.stamp.to_s) assert_equal(nil, d.from) assert_equal('jabber:x:delay', d.namespace) end |
#test_from ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/vendor/xmpp4r/test/delay/tc_xdelay.rb', line 26 def test_from d = Delay::XDelay.new assert_equal(nil, d.from) d.from = JID.new('[email protected]') assert_equal(JID.new('[email protected]'), d.from) assert_equal(d, d.set_from(nil)) assert_equal(nil, d.from) end |
#test_import ⇒ Object
45 46 47 48 49 50 |
# File 'lib/vendor/xmpp4r/test/delay/tc_xdelay.rb', line 45 def test_import x1 = X.new x1.add_namespace('jabber:x:delay') x2 = X::import(x1) assert_equal(Delay::XDelay, x2.class) end |
#test_stamp ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/vendor/xmpp4r/test/delay/tc_xdelay.rb', line 35 def test_stamp d = Delay::XDelay.new(false) assert_equal(nil, d.stamp) now = Time.now d.stamp = now assert_equal(now.to_s, d.stamp.to_s) assert_equal(d, d.set_stamp(nil)) assert_equal(nil, d.stamp) end |