source: trunk/dports/ruby/rb-rjab-connection/files/patch-test-tc_Node.rb @ 21497

Last change on this file since 21497 was 21497, checked in by eridius@…, 13 years ago

Massive update to svn properties on files:
All patchfiles have svn:eol-style removed.
All files that are not in fact able to be executed have svn:executable removed
All binary files have svn:eol-style removed (and are probably corrupt)
All binary files have svn:mime-type set to application/octet-stream
All files which are not patchfiles or binary files have svn:eol-style set to native
All Portfiles have svn:eol-style set to native and svn:executable removed

File size: 1011 bytes
Line 
1--- orig_src/test/tc_Node.rb    Wed Dec 31 16:00:00 1969
2+++ tests/tc_Node.rb    Mon Jan 19 15:20:38 2004
3@@ -0,0 +1,38 @@
4+##
5+# $Id: patch-test-tc_Node.rb,v 1.1 2004/02/06 04:21:11 rshaw Exp $
6+#
7+
8+require 'test/unit'
9+
10+require 'rjab/conn/node'
11+
12+class TestNode < Test::Unit::TestCase
13+    def setup
14+    end
15+
16+    def teardown
17+    end
18+
19+    def test_new
20+        # test node create with string arg
21+        node = Jabber::Node.new('abc')
22+        str = ""
23+        node.write str, -1
24+        assert_equal '<abc/>', str, 'Node.new(string)'
25+       
26+        # test node create with XML arg
27+        node = Jabber::Node.new('<cde/>')
28+        str = ""
29+        node.write str, -1
30+        assert_equal '<cde/>', str, 'Node.new(xml)'
31+    end
32+
33+    def test_new_message
34+        node = Jabber::Node.new_message('foo@bar', 'body')
35+        str = ""
36+        node.write str, -1
37+        assert_equal "<message to='foo@bar'><body>body</body></message>", \
38+            str, 'Node.new_massage()'
39+    end
40+
41+end
Note: See TracBrowser for help on using the repository browser.