testunitxml 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/CHANGES +15 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +119 -0
  4. data/docs/html/classes/REXML/Attributes.html +6 -6
  5. data/docs/html/classes/REXML/Attributes.src/{M000001.html → M000004.html} +0 -0
  6. data/docs/html/classes/REXML/DocType.html +207 -0
  7. data/docs/html/classes/REXML/DocType.src/M000005.html +18 -0
  8. data/docs/html/classes/REXML/DocType.src/M000006.html +18 -0
  9. data/docs/html/classes/REXML/DocType.src/M000007.html +18 -0
  10. data/docs/html/classes/REXML/DocType.src/M000008.html +20 -0
  11. data/docs/html/classes/REXML/NotationDecl.html +188 -0
  12. data/docs/html/classes/REXML/NotationDecl.src/M000001.html +18 -0
  13. data/docs/html/classes/REXML/NotationDecl.src/M000002.html +18 -0
  14. data/docs/html/classes/REXML/NotationDecl.src/M000003.html +19 -0
  15. data/docs/html/classes/REXML.html +10 -0
  16. data/docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.html +5 -5
  17. data/docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/{M000007.html → M000014.html} +0 -0
  18. data/docs/html/classes/Test/Unit/XML/NodeIterator.html +20 -20
  19. data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000003.html → M000010.html} +0 -0
  20. data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000004.html → M000011.html} +0 -0
  21. data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000005.html → M000012.html} +0 -0
  22. data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000006.html → M000013.html} +0 -0
  23. data/docs/html/classes/Test/Unit/XML/XmlEqualFilter.html +5 -5
  24. data/docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/{M000008.html → M000015.html} +4 -0
  25. data/docs/html/classes/Test/Unit/XML.html +49 -11
  26. data/docs/html/classes/Test/Unit/XML.src/{M000002.html → M000009.html} +1 -1
  27. data/docs/html/created.rid +1 -1
  28. data/docs/html/files/CHANGES.html +127 -0
  29. data/docs/html/files/README.html +64 -25
  30. data/docs/html/files/lib/test/unit/xml/doctype_mixin_rb.html +101 -0
  31. data/docs/html/files/lib/test/unit/xml/notationdecl_mixin_rb.html +101 -0
  32. data/docs/html/files/lib/test/unit/xml/xml_assertions_rb.html +3 -1
  33. data/docs/html/files/lib/test/unit/xml/xmlequalfilter_rb.html +1 -1
  34. data/docs/html/fr_class_index.html +2 -0
  35. data/docs/html/fr_file_index.html +3 -0
  36. data/docs/html/fr_method_index.html +15 -8
  37. data/lib/test/unit/xml/doctype_mixin.rb +32 -0
  38. data/lib/test/unit/xml/notationdecl_mixin.rb +54 -0
  39. data/lib/test/unit/xml/xml_assertions.rb +75 -7
  40. data/lib/test/unit/xml/xmlequalfilter.rb +10 -6
  41. data/setup.rb +1585 -0
  42. data/test/tc_notationdecl_mixin.rb +50 -0
  43. data/test/tc_testunitxml.rb +172 -1
  44. data/test/ts_testunitxml.rb +12 -0
  45. metadata +33 -11
@@ -0,0 +1,50 @@
1
+ #! /usr/bin/ruby
2
+
3
+
4
+ @@lib_path = File.join(File.dirname(__FILE__), "..", "lib")
5
+ $:.unshift @@lib_path
6
+
7
+ require 'test/unit/xml'
8
+
9
+ class TestNotationDecl < Test::Unit::TestCase
10
+
11
+ def setup
12
+ doc_string = <<-'XMLEND'
13
+ <!DOCTYPE r SYSTEM "urn:x-henrikmartensson:test" [
14
+ <!NOTATION n1 PUBLIC "TEST1">
15
+ <!NOTATION n2 PUBLIC "TEST2" "urn:x-henrikmartensson.org:test2">
16
+ <!NOTATION n3 PUBLIC 'TEST3'>
17
+ <!NOTATION n4 PUBLIC 'TEST4' 'urn:x-henrikmartensson.org:test4'>
18
+ <!NOTATION n5 PUBLIC "TEST5" 'urn:x-henrikmartensson.org:test5'>
19
+ <!NOTATION n6 PUBLIC 'TEST6' "urn:x-henrikmartensson.org:test6">
20
+ <!NOTATION n7 SYSTEM "urn:x-henrikmartensson.org:test7">
21
+ ]>
22
+ <r/>
23
+ XMLEND
24
+ @doctype = REXML::Document.new(doc_string).doctype
25
+ end
26
+
27
+ def test_public
28
+ assert_equal('TEST1', @doctype.notation('n1').public)
29
+ assert_equal('TEST2', @doctype.notation('n2').public)
30
+ assert_equal('TEST3', @doctype.notation('n3').public)
31
+ assert_equal('TEST4', @doctype.notation('n4').public)
32
+ # The TEST5 and TEST6 assertions have been commented out because
33
+ # REXML 3.1.2 does not parse the notations correctly.
34
+ #assert_equal('TEST5', @doctype.notation('n5').public)
35
+ #assert_equal('TEST6', @doctype.notation('n6').public)
36
+ assert_nil(@doctype.notation('n7').public)
37
+ end
38
+
39
+ def test_system
40
+ assert_equal("urn:x-henrikmartensson.org:test2", @doctype.notation('n2').system)
41
+ assert_nil(@doctype.notation('n3').system)
42
+ assert_equal("urn:x-henrikmartensson.org:test4", @doctype.notation('n4').system)
43
+ # The TEST5 and TEST6 assertions have been commented out because
44
+ # REXML 3.1.2 does not parse the notations correctly.
45
+ #assert_equal('urn:x-henrikmartensson.org:test5', @doctype.notation('n5').system)
46
+ #assert_equal('urn:x-henrikmartensson.org:test6', @doctype.notation('n6').system)
47
+ assert_equal("urn:x-henrikmartensson.org:test7", @doctype.notation('n7').system)
48
+ end
49
+
50
+ end
@@ -41,7 +41,7 @@ class TestTestUnitXml < Test::Unit::TestCase
41
41
  @xml_decl1 = REXML::XMLDecl.new(1.0, "utf-8", "yes")
42
42
  @xml_decl2 = REXML::XMLDecl.new(1.1, "utf-8", "yes")
43
43
  @xml_decl3 = REXML::XMLDecl.new(1.0, "utf-16", "yes")
44
- @xml_decl4 = REXML::XMLDecl.new(1.0, "utf-8", "no")
44
+ @xml_decl4 = REXML::XMLDecl.new(1.0, "utf-8", "no")
45
45
  end
46
46
 
47
47
  def teardown
@@ -119,5 +119,176 @@ class TestTestUnitXml < Test::Unit::TestCase
119
119
  assert_xml_equal(@xml_decl1, @xml_decl1)
120
120
  check_assertion_failure(@xml_decl1, @xml_decl2)
121
121
  end
122
+
123
+ def test_assert_xml_equal_doctype
124
+ string1 = <<-'XMLEND'
125
+ <!DOCTYPE r PUBLIC "TEST1" "http://www.henrikmartensson.org/dtd1">
126
+ <r/>
127
+ XMLEND
128
+ string2 = <<-'XMLEND'
129
+ <!DOCTYPE r PUBLIC "TEST1" "http://www.henrikmartensson.org/dtd2">
130
+ <r/>
131
+ XMLEND
132
+ string3 = <<-'XMLEND'
133
+ <!DOCTYPE r PUBLIC "TEST2" "http://www.henrikmartensson.org/dtd1">
134
+ <r/>
135
+ XMLEND
136
+ string4 = <<-'XMLEND'
137
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1">
138
+ <r/>
139
+ XMLEND
140
+ string5 = <<-'XMLEND'
141
+ <!DOCTYPE r SYSTEM "urn:x-henrikmartensson.org:dtd1">
142
+ <r/>
143
+ XMLEND
144
+ string6 = <<-'XMLEND'
145
+ <!DOCTYPE r SYSTEM "urn:x-henrikmartensson.org:dtd2">
146
+ <r/>
147
+ XMLEND
148
+ assert_xml_equal(string1, string1)
149
+ assert_xml_equal(string1, string2)
150
+ check_assertion_failure(string1, string3)
151
+ check_assertion_failure(string1, string4)
152
+ check_assertion_failure(string1, string5)
153
+ assert_xml_equal(string5, string5)
154
+ check_assertion_failure(string5, string6)
155
+ end
156
+
157
+ def test_assert_xml_equal_internal_entity_decl
158
+ string1 = <<-'XMLEND'
159
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
160
+ <!ENTITY internal1 "This is an internal entity">
161
+ ]>
162
+ <r/>
163
+ XMLEND
164
+ string2 = <<-'XMLEND'
165
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
166
+ <!ENTITY internal1 "This is another internal entity">
167
+ ]>
168
+ <r>&internal1;</r>
169
+ XMLEND
170
+ string3 = <<-'XMLEND'
171
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
172
+ <!ENTITY internal1 "This is an internal entity">
173
+ <!ENTITY internal2 "This is another internal entity">
174
+ ]>
175
+ <r>&internal1;</r>
176
+ XMLEND
177
+ string4 = <<-'XMLEND'
178
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
179
+ <!ENTITY internal2 "This is another internal entity">
180
+ <!ENTITY internal1 "This is an internal entity">
181
+ ]>
182
+ <r>&internal1;</r>
183
+ XMLEND
184
+ string5 = <<-'XMLEND'
185
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
186
+ <!ENTITY internal1 "This is an internal entity">
187
+ <!ENTITY internal2 "This is another internal entity">
188
+ <!ENTITY internal3 "This is a third internal entity">
189
+ ]>
190
+ <r>&internal1;</r>
191
+ XMLEND
192
+ assert_xml_equal(string1, string1)
193
+ check_assertion_failure(string1, string2)
194
+ check_assertion_failure(string1, string3)
195
+ check_assertion_failure(string3, string1)
196
+ assert_xml_equal(string3, string4,"Testing that entities may be declared in any order")
197
+ end
198
+
199
+ def test_assert_xml_equal_external_entity_decl
200
+ string1 = <<-'XMLEND'
201
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
202
+ <!NOTATION pdf SYSTEM "pdf">
203
+ <!NOTATION word SYSTEM "word">
204
+ <!ENTITY external1 SYSTEM "urn:x-henrikmartensson.org:resource1" NDATA pdf>
205
+ ]>
206
+ <r/>
207
+ XMLEND
208
+ string2 = <<-'XMLEND'
209
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
210
+ <!NOTATION pdf SYSTEM "pdf">
211
+ <!NOTATION word SYSTEM "word">
212
+ <!ENTITY external1 SYSTEM "urn:x-henrikmartensson.org:resource1" NDATA word>
213
+ ]>
214
+ <r/>
215
+ XMLEND
216
+ string3 = <<-'XMLEND'
217
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
218
+ <!NOTATION pdf SYSTEM "pdf">
219
+ <!ENTITY external1 SYSTEM "urn:x-henrikmartensson.org:resource1" NDATA pdf>
220
+ <!NOTATION word SYSTEM "word">
221
+ ]>
222
+ <r/>
223
+ XMLEND
224
+ assert_xml_equal(string1, string1)
225
+ check_assertion_failure(string1, string2)
226
+ assert_xml_equal(string1, string3)
227
+ end
228
+
229
+ def test_assert_xml_equal_notation_decl
230
+ string1 = <<-'XMLEND'
231
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
232
+ <!NOTATION pdf SYSTEM "pdf">
233
+ ]>
234
+ <r/>
235
+ XMLEND
236
+ string2 = <<-'XMLEND'
237
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
238
+ <!NOTATION pdf PUBLIC "pdf">
239
+ ]>
240
+ <r/>
241
+ XMLEND
242
+ string3 = <<-'XMLEND'
243
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
244
+ <!NOTATION pdf SYSTEM "word">
245
+ ]>
246
+ <r/>
247
+ XMLEND
248
+ assert_xml_equal(string1, string1)
249
+ check_assertion_failure(string1, string2)
250
+ check_assertion_failure(string1, string3)
251
+ end
252
+
253
+ def test_assert_xml_equal_doctype_comment
254
+ string1 = <<-'XMLEND'
255
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
256
+ <!NOTATION pdf SYSTEM "pdf">
257
+ <!-- A comment -->
258
+ ]>
259
+ <r/>
260
+ XMLEND
261
+ string2 = <<-'XMLEND'
262
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
263
+ <!-- A comment -->
264
+ <!NOTATION pdf SYSTEM "pdf">
265
+ ]>
266
+ <r/>
267
+ XMLEND
268
+ string3 = <<-'XMLEND'
269
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
270
+ <!NOTATION pdf SYSTEM "pdf">
271
+ <!-- A different comment -->
272
+ ]>
273
+ <r/>
274
+ XMLEND
275
+ string4 = <<-'XMLEND'
276
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
277
+ <!-- A comment -->
278
+ <!-- Another comment -->
279
+ ]>
280
+ <r/>
281
+ XMLEND
282
+ string5 = <<-'XMLEND'
283
+ <!DOCTYPE r SYSTEM "http://www.henrikmartensson.org/dtd1" [
284
+ <!-- Another comment -->
285
+ <!-- A comment -->
286
+ ]>
287
+ <r/>
288
+ XMLEND
289
+ assert_xml_equal(string1, string2)
290
+ check_assertion_failure(string1, string3)
291
+ check_assertion_failure(string4, string5)
292
+ end
122
293
 
123
294
  end
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/ruby
2
+
3
+ @@lib_path = File.join(File.dirname(__FILE__), "..", "lib")
4
+ $:.unshift @@lib_path
5
+ $:.unshift File.dirname(__FILE__)
6
+
7
+ require 'test/unit'
8
+
9
+ Dir.foreach(File.dirname(__FILE__)) { |file|
10
+ load file if file =~ /^tc.+\.rb$/
11
+ }
12
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: testunitxml
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
7
- date: 2006-01-11 00:00:00 +01:00
6
+ version: 0.1.4
7
+ date: 2006-01-23 00:00:00 +01:00
8
8
  summary: Unit test suite for XML documents
9
9
  require_paths:
10
10
  - lib
@@ -28,6 +28,10 @@ cert_chain:
28
28
  authors:
29
29
  - Henrik Martensson
30
30
  files:
31
+ - README
32
+ - CHANGES
33
+ - MIT-LICENSE
34
+ - setup.rb
31
35
  - docs/html
32
36
  - docs/html/created.rid
33
37
  - docs/html/files
@@ -37,6 +41,7 @@ files:
37
41
  - docs/html/fr_method_index.html
38
42
  - docs/html/index.html
39
43
  - docs/html/files/README.html
44
+ - docs/html/files/CHANGES.html
40
45
  - docs/html/files/MIT-LICENSE.html
41
46
  - docs/html/files/lib
42
47
  - docs/html/files/lib/test
@@ -47,33 +52,46 @@ files:
47
52
  - docs/html/files/lib/test/unit/xml/nodeiterator_rb.html
48
53
  - docs/html/files/lib/test/unit/xml/attributes_mixin_rb.html
49
54
  - docs/html/files/lib/test/unit/xml/xml_assertions_rb.html
55
+ - docs/html/files/lib/test/unit/xml/doctype_mixin_rb.html
56
+ - docs/html/files/lib/test/unit/xml/notationdecl_mixin_rb.html
50
57
  - docs/html/classes/REXML
51
58
  - docs/html/classes/Test
52
59
  - docs/html/classes/REXML.html
53
60
  - docs/html/classes/Test.html
61
+ - docs/html/classes/REXML/NotationDecl.src
54
62
  - docs/html/classes/REXML/Attributes.src
63
+ - docs/html/classes/REXML/DocType.src
64
+ - docs/html/classes/REXML/NotationDecl.html
55
65
  - docs/html/classes/REXML/Attributes.html
56
- - docs/html/classes/REXML/Attributes.src/M000001.html
66
+ - docs/html/classes/REXML/DocType.html
67
+ - docs/html/classes/REXML/NotationDecl.src/M000001.html
68
+ - docs/html/classes/REXML/NotationDecl.src/M000002.html
69
+ - docs/html/classes/REXML/NotationDecl.src/M000003.html
70
+ - docs/html/classes/REXML/Attributes.src/M000004.html
71
+ - docs/html/classes/REXML/DocType.src/M000005.html
72
+ - docs/html/classes/REXML/DocType.src/M000006.html
73
+ - docs/html/classes/REXML/DocType.src/M000007.html
74
+ - docs/html/classes/REXML/DocType.src/M000008.html
57
75
  - docs/html/classes/Test/Unit
58
76
  - docs/html/classes/Test/Unit.html
59
77
  - docs/html/classes/Test/Unit/XML.src
60
78
  - docs/html/classes/Test/Unit/XML
61
79
  - docs/html/classes/Test/Unit/XML.html
62
80
  - docs/html/classes/Test/Unit/TestCase.html
63
- - docs/html/classes/Test/Unit/XML.src/M000002.html
81
+ - docs/html/classes/Test/Unit/XML.src/M000009.html
64
82
  - docs/html/classes/Test/Unit/XML/NodeIterator.src
65
83
  - docs/html/classes/Test/Unit/XML/NodeIterator
66
84
  - docs/html/classes/Test/Unit/XML/XmlEqualFilter.src
67
85
  - docs/html/classes/Test/Unit/XML/NodeIterator.html
68
86
  - docs/html/classes/Test/Unit/XML/XmlEqualFilter.html
69
- - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000003.html
70
- - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000004.html
71
- - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000005.html
72
- - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000006.html
87
+ - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000010.html
88
+ - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000011.html
89
+ - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000012.html
90
+ - docs/html/classes/Test/Unit/XML/NodeIterator.src/M000013.html
73
91
  - docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src
74
92
  - docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.html
75
- - docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/M000007.html
76
- - docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/M000008.html
93
+ - docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/M000014.html
94
+ - docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/M000015.html
77
95
  - lib/test
78
96
  - lib/test/unit
79
97
  - lib/test/unit/xml
@@ -82,11 +100,15 @@ files:
82
100
  - lib/test/unit/xml/nodeiterator.rb
83
101
  - lib/test/unit/xml/attributes_mixin.rb
84
102
  - lib/test/unit/xml/xml_assertions.rb
103
+ - lib/test/unit/xml/doctype_mixin.rb
104
+ - lib/test/unit/xml/notationdecl_mixin.rb
85
105
  - test/data
86
106
  - test/tc_testunitxml.rb
107
+ - test/tc_notationdecl_mixin.rb
108
+ - test/ts_testunitxml.rb
87
109
  - test/data/test1.xml
88
110
  test_files:
89
- - test/tc_testunitxml.rb
111
+ - test/ts_testunitxml.rb
90
112
  rdoc_options: []
91
113
 
92
114
  extra_rdoc_files: []