testunitxml 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +4 -0
- data/README +1 -1
- data/docs/html/classes/REXML/DocType.src/M000005.html +7 -2
- data/docs/html/classes/REXML/DocType.src/M000006.html +7 -2
- data/docs/html/classes/REXML/DocType.src/M000007.html +1 -1
- data/docs/html/classes/REXML/DocType.src/M000008.html +1 -1
- data/docs/html/classes/Test.html +4 -0
- data/docs/html/classes/Test/Unit.html +4 -0
- data/docs/html/classes/Test/Unit/XML.html +26 -1
- data/docs/html/classes/Test/Unit/XML.src/M000009.html +1 -1
- data/docs/html/classes/Test/Unit/XML.src/M000010.html +23 -0
- data/docs/html/classes/Test/Unit/XML/Conditionals.html +173 -0
- data/docs/html/classes/Test/Unit/XML/Conditionals.src/M000011.html +19 -0
- data/docs/html/classes/Test/Unit/XML/Conditionals.src/M000012.html +42 -0
- data/docs/html/classes/Test/Unit/XML/NodeIterator.html +20 -20
- data/docs/html/classes/Test/Unit/XML/NodeIterator.src/M000013.html +13 -6
- data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000011.html → M000014.html} +0 -0
- data/docs/html/classes/Test/Unit/XML/NodeIterator.src/{M000012.html → M000015.html} +0 -0
- data/docs/html/classes/Test/Unit/XML/NodeIterator.src/M000016.html +20 -0
- data/docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.html +5 -5
- data/docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/{M000014.html → M000017.html} +0 -0
- data/docs/html/classes/Test/Unit/XML/XmlEqualFilter.html +5 -5
- data/docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/{M000015.html → M000018.html} +0 -0
- data/docs/html/created.rid +1 -1
- data/docs/html/files/CHANGES.html +10 -1
- data/docs/html/files/README.html +2 -2
- data/docs/html/files/lib/test/unit/xml/conditionals_rb.html +101 -0
- data/docs/html/files/lib/test/unit/xml/doctype_mixin_rb.html +8 -1
- data/docs/html/files/lib/test/unit/xml/xml_assertions_rb.html +2 -1
- data/docs/html/fr_class_index.html +1 -0
- data/docs/html/fr_file_index.html +1 -0
- data/docs/html/fr_method_index.html +11 -8
- data/lib/test/unit/xml/conditionals.rb +141 -0
- data/lib/test/unit/xml/doctype_mixin.rb +24 -2
- data/lib/test/unit/xml/xml_assertions.rb +22 -114
- data/test/tc_attributes_mixin.rb +37 -0
- data/test/tc_doctype_mixin.rb +71 -0
- data/test/tc_notationdecl_mixin.rb +39 -21
- data/test/tc_testunitxml.rb +21 -0
- metadata +16 -7
- data/docs/html/classes/Test/Unit/XML/NodeIterator.src/M000010.html +0 -27
@@ -1,3 +1,6 @@
|
|
1
|
+
|
2
|
+
require 'test/unit/xml/notationdecl_mixin'
|
3
|
+
|
1
4
|
module REXML
|
2
5
|
|
3
6
|
# The REXML::DocType mix-in adds methods that are useful for
|
@@ -7,12 +10,22 @@ module REXML
|
|
7
10
|
|
8
11
|
# This method retrieves the public identifier identifying the document's DTD.
|
9
12
|
def public
|
10
|
-
@
|
13
|
+
case @external_id
|
14
|
+
when "SYSTEM"
|
15
|
+
nil
|
16
|
+
when "PUBLIC"
|
17
|
+
strip_quotes(@long_name)
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
21
|
# This method retrieves the system identifier identifying the document's DTD
|
14
22
|
def system
|
15
|
-
@
|
23
|
+
case @external_id
|
24
|
+
when "SYSTEM"
|
25
|
+
strip_quotes(@long_name)
|
26
|
+
when "PUBLIC"
|
27
|
+
@uri.kind_of?(String) ? strip_quotes(@uri) : nil
|
28
|
+
end
|
16
29
|
end
|
17
30
|
|
18
31
|
# This method returns a list of notations that have been declared in the
|
@@ -28,5 +41,14 @@ module REXML
|
|
28
41
|
notation_decl.name == name
|
29
42
|
}
|
30
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def strip_quotes(quoted_string)
|
48
|
+
quoted_string =~ /^[\'\"].*[\�\"]$/ ?
|
49
|
+
quoted_string[1, quoted_string.length-2] :
|
50
|
+
quoted_string
|
51
|
+
end
|
52
|
+
|
31
53
|
end
|
32
54
|
end
|
@@ -5,6 +5,7 @@ require 'test/unit/xml/attributes_mixin' # Must be required after rexml/document
|
|
5
5
|
require 'test/unit/xml/doctype_mixin' # Must be required after rexml/document
|
6
6
|
require 'test/unit/xml/notationdecl_mixin' # Must be required after rexml/document
|
7
7
|
require 'test/unit'
|
8
|
+
require 'test/unit/xml/conditionals'
|
8
9
|
require 'test/unit/xml/xmlequalfilter'
|
9
10
|
require 'test/unit/xml/nodeiterator'
|
10
11
|
|
@@ -15,7 +16,7 @@ meant to be mixed in to test classes such as Test::Unit::TestCase.
|
|
15
16
|
module Test
|
16
17
|
module Unit
|
17
18
|
module XML
|
18
|
-
|
19
|
+
|
19
20
|
# This method checks whether two well-formed XML documents are equal.
|
20
21
|
# Two XML documents are considered equal if:
|
21
22
|
# * They contain the same type of nodes, in the same order,
|
@@ -105,6 +106,23 @@ EOT
|
|
105
106
|
end
|
106
107
|
end
|
107
108
|
|
109
|
+
|
110
|
+
# This method compares two XML documents and returns +true+ if they are
|
111
|
+
# _not_ equal, +false+ otherwise. This is the inverse of assert_xml_equal.
|
112
|
+
def assert_xml_not_equal(expected_doc, actual_doc, message = nil)
|
113
|
+
expected_doc = parse_xml(expected_doc)
|
114
|
+
actual_doc = parse_xml(actual_doc)
|
115
|
+
_wrap_assertion do
|
116
|
+
full_message = build_message(message, <<EOT, actual_doc.inspect, expected_doc.inspect)
|
117
|
+
|
118
|
+
<?> expected not to be equal to
|
119
|
+
<?> but was equal.
|
120
|
+
EOT
|
121
|
+
assert_block(full_message){ ! are_equal?(expected_doc, actual_doc)}
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
|
108
126
|
private
|
109
127
|
|
110
128
|
def parse_xml(xml)
|
@@ -119,8 +137,9 @@ EOT
|
|
119
137
|
end
|
120
138
|
|
121
139
|
def are_equal?(expected_doc, actual_doc)
|
140
|
+
comparator = Conditionals.create
|
122
141
|
iterate(expected_doc, actual_doc) do |expected_node, actual_node|
|
123
|
-
unless compare_xml_nodes(expected_node, actual_node)
|
142
|
+
unless comparator.compare_xml_nodes(expected_node, actual_node)
|
124
143
|
return false
|
125
144
|
end
|
126
145
|
end
|
@@ -137,118 +156,7 @@ EOT
|
|
137
156
|
yield expected_node, actual_node
|
138
157
|
end
|
139
158
|
end
|
140
|
-
|
141
|
-
def compare_xml_nodes(expected_node, actual_node)
|
142
|
-
return false unless actual_node.instance_of? expected_node.class
|
143
|
-
case actual_node
|
144
|
-
when REXML::Document
|
145
|
-
# TODO: Implement Document comparison
|
146
|
-
true
|
147
|
-
when REXML::DocType
|
148
|
-
compare_doctypes(expected_node, actual_node)
|
149
|
-
when REXML::Element :
|
150
|
-
compare_elements(expected_node, actual_node)
|
151
|
-
when REXML::CData
|
152
|
-
compare_texts(expected_node, actual_node)
|
153
|
-
when REXML::Text
|
154
|
-
compare_texts(expected_node, actual_node)
|
155
|
-
when REXML::Comment
|
156
|
-
compare_comments(expected_node, actual_node)
|
157
|
-
when REXML::Instruction
|
158
|
-
compare_pi(expected_node, actual_node)
|
159
|
-
when REXML::XMLDecl
|
160
|
-
compare_xml_declaration(expected_node, actual_node)
|
161
|
-
#when REXML::Entity
|
162
|
-
# compare_xml_entities(expected_node, actual_node)
|
163
|
-
else
|
164
|
-
puts "Unknown node type #{actual_node.class}"
|
165
|
-
false
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
def compare_doctypes(expected_node, actual_node)
|
170
|
-
return compare_system_id(expected_node.system, actual_node.system) &&
|
171
|
-
expected_node.public == actual_node.public &&
|
172
|
-
compare_xml_internal_dtd_subset(expected_node, actual_node)
|
173
|
-
end
|
174
|
-
|
175
|
-
def compare_system_id(expected_id, actual_id)
|
176
|
-
is_expected_urn = expected_id =~ /^urn:/i
|
177
|
-
is_actual_urn = actual_id =~ /^urn:/i
|
178
|
-
if is_expected_urn || is_actual_urn
|
179
|
-
expected_id == actual_id
|
180
|
-
else
|
181
|
-
true
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
def compare_elements(expected_node, actual_node)
|
186
|
-
return expected_node.name == actual_node.name &&
|
187
|
-
expected_node.namespace() == actual_node.namespace() &&
|
188
|
-
compare_attributes(expected_node.attributes, actual_node.attributes)
|
189
|
-
end
|
190
|
-
|
191
|
-
def compare_attributes(expected_attributes, actual_attributes)
|
192
|
-
return false unless attribute_count(expected_attributes) == attribute_count(actual_attributes)
|
193
|
-
expected_attributes.each_attribute do |expected_attribute|
|
194
|
-
expected_prefix = expected_attribute.prefix()
|
195
|
-
unless expected_prefix == 'xmlns' then
|
196
|
-
expected_name = expected_attribute.name
|
197
|
-
expected_namespace = expected_attribute.namespace
|
198
|
-
actual_attribute = actual_attributes.get_attribute_ns(expected_namespace, expected_name)
|
199
|
-
return false unless actual_attribute
|
200
|
-
return false if expected_attribute != actual_attribute
|
201
|
-
end
|
202
|
-
end
|
203
|
-
true
|
204
|
-
end
|
205
|
-
|
206
|
-
def attribute_count(attributes)
|
207
|
-
# Do not count namespace declarations
|
208
|
-
attributes.size - attributes.prefixes.size
|
209
|
-
end
|
210
|
-
|
211
|
-
def compare_texts(expected_node, actual_node)
|
212
|
-
expected_node.value.eql?(actual_node.value)
|
213
|
-
end
|
214
|
-
|
215
|
-
def compare_comments(expected_node, actual_node)
|
216
|
-
expected_node == actual_node
|
217
|
-
end
|
218
|
-
|
219
|
-
def compare_pi(expected_pi, actual_pi)
|
220
|
-
return expected_pi.target == actual_pi.target &&
|
221
|
-
expected_pi.content == actual_pi.content
|
222
|
-
end
|
223
|
-
|
224
|
-
def compare_xml_declaration(expected_decl, actual_decl)
|
225
|
-
return expected_decl == actual_decl
|
226
|
-
end
|
227
|
-
|
228
|
-
def compare_xml_internal_dtd_subset(expected_node, actual_node)
|
229
|
-
expected_subset = expected_node.children()
|
230
|
-
actual_subset = actual_node.children()
|
231
|
-
return false unless expected_subset.length == actual_subset.length
|
232
|
-
expected_subset.inject(true) { |memo, expected_decl|
|
233
|
-
case expected_decl
|
234
|
-
when REXML::Entity
|
235
|
-
memo &&
|
236
|
-
expected_decl.value == actual_node.entities[expected_decl.name].value &&
|
237
|
-
expected_decl.ndata == actual_node.entities[expected_decl.name].ndata
|
238
|
-
when REXML::NotationDecl
|
239
|
-
actual_notation_decl = actual_node.notation(expected_decl.name)
|
240
|
-
memo &&
|
241
|
-
actual_notation_decl != nil &&
|
242
|
-
expected_decl.name == actual_notation_decl.name &&
|
243
|
-
expected_decl.public == actual_notation_decl.public &&
|
244
|
-
expected_decl.system == actual_notation_decl.system
|
245
|
-
when REXML::Comment
|
246
|
-
true
|
247
|
-
else
|
248
|
-
raise "Unexpected node type in internal DTD subset of expected document: " + expected_decl.inspect
|
249
|
-
end
|
250
|
-
}
|
251
|
-
end
|
159
|
+
|
252
160
|
end
|
253
161
|
end
|
254
162
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#! /usr/local/bin/ruby
|
2
|
+
|
3
|
+
|
4
|
+
@@lib_path = File.join(File.dirname(__FILE__), "..", "lib")
|
5
|
+
$:.unshift @@lib_path
|
6
|
+
|
7
|
+
require 'test/unit'
|
8
|
+
require 'rexml/document'
|
9
|
+
require 'test/unit/xml/attributes_mixin.rb'
|
10
|
+
|
11
|
+
class TestAttributes < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@ns_a = "urn:x-test:a"
|
15
|
+
@ns_b = "urn:x-test:b"
|
16
|
+
element_string = <<-"XMLEND"
|
17
|
+
<test xmlns:a="#{@ns_a}"
|
18
|
+
xmlns:b="#{@ns_b}"
|
19
|
+
a = "1"
|
20
|
+
b = '2'
|
21
|
+
a:c = "3"
|
22
|
+
a:d = '4'
|
23
|
+
a:e = "5"
|
24
|
+
b:f = "6"/>
|
25
|
+
XMLEND
|
26
|
+
@attributes = REXML::Document.new(element_string).root.attributes
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_get_attribute_ns
|
30
|
+
assert_equal("1", @attributes.get_attribute_ns("", "a").value)
|
31
|
+
assert_equal("2", @attributes.get_attribute_ns("", "b").value)
|
32
|
+
assert_equal("3", @attributes.get_attribute_ns(@ns_a, "c").value)
|
33
|
+
assert_equal("4", @attributes.get_attribute_ns(@ns_a, "d").value)
|
34
|
+
assert_equal("5", @attributes.get_attribute_ns(@ns_a, "e").value)
|
35
|
+
assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value)
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
#! /usr/local/bin/ruby
|
2
|
+
|
3
|
+
|
4
|
+
@@lib_path = File.join(File.dirname(__FILE__), "..", "lib")
|
5
|
+
$:.unshift @@lib_path
|
6
|
+
|
7
|
+
require 'test/unit'
|
8
|
+
require 'rexml/document'
|
9
|
+
require 'test/unit/xml/doctype_mixin.rb'
|
10
|
+
|
11
|
+
class TestDoctype < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@sysid = "urn:x-test:sysid1"
|
15
|
+
@notid1 = "urn:x-test:notation1"
|
16
|
+
@notid2 = "urn:x-test:notation2"
|
17
|
+
document_string1 = <<-"XMLEND"
|
18
|
+
<!DOCTYPE r SYSTEM "#{@sysid}" [
|
19
|
+
<!NOTATION n1 SYSTEM "#{@notid1}">
|
20
|
+
<!NOTATION n2 SYSTEM "#{@notid2}">
|
21
|
+
]>
|
22
|
+
<r/>
|
23
|
+
XMLEND
|
24
|
+
@doctype1 = REXML::Document.new(document_string1).doctype
|
25
|
+
|
26
|
+
@pubid = "TEST_ID"
|
27
|
+
document_string2 = <<-"XMLEND"
|
28
|
+
<!DOCTYPE r PUBLIC "#{@pubid}">
|
29
|
+
<r/>
|
30
|
+
XMLEND
|
31
|
+
@doctype2 = REXML::Document.new(document_string2).doctype
|
32
|
+
|
33
|
+
document_string3 = <<-"XMLEND"
|
34
|
+
<!DOCTYPE r PUBLIC "#{@pubid}" "#{@sysid}">
|
35
|
+
<r/>
|
36
|
+
XMLEND
|
37
|
+
@doctype3 = REXML::Document.new(document_string3).doctype
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_public
|
42
|
+
assert_equal(nil, @doctype1.public)
|
43
|
+
assert_equal(@pubid, @doctype2.public)
|
44
|
+
assert_equal(@pubid, @doctype3.public)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_system
|
48
|
+
assert_equal(@sysid, @doctype1.system)
|
49
|
+
assert_equal(nil, @doctype2.system)
|
50
|
+
assert_equal(@sysid, @doctype3.system)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_notation
|
54
|
+
assert_equal(@notid1, @doctype1.notation("n1").system)
|
55
|
+
assert_equal(@notid2, @doctype1.notation("n2").system)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_notations
|
59
|
+
notations = @doctype1.notations
|
60
|
+
assert_equal(2, notations.length)
|
61
|
+
assert_equal(@notid1, find_notation(notations, "n1").system)
|
62
|
+
assert_equal(@notid2, find_notation(notations, "n2").system)
|
63
|
+
end
|
64
|
+
|
65
|
+
def find_notation(notations, name)
|
66
|
+
notations.find { |notation|
|
67
|
+
name == notation.name
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -1,50 +1,68 @@
|
|
1
|
-
#! /usr/bin/ruby
|
1
|
+
#! /usr/local/bin/ruby
|
2
2
|
|
3
3
|
|
4
4
|
@@lib_path = File.join(File.dirname(__FILE__), "..", "lib")
|
5
5
|
$:.unshift @@lib_path
|
6
6
|
|
7
|
-
require 'test/unit
|
7
|
+
require 'test/unit'
|
8
|
+
require 'rexml/document'
|
9
|
+
require 'test/unit/xml/doctype_mixin'
|
10
|
+
require 'test/unit/xml/notationdecl_mixin'
|
8
11
|
|
9
12
|
class TestNotationDecl < Test::Unit::TestCase
|
10
13
|
|
11
14
|
def setup
|
12
|
-
|
15
|
+
@pubid1 = "TEST1"
|
16
|
+
@pubid2 = "TEST2"
|
17
|
+
@sysid2 = "urn:x-henrikmartensson.org:test2"
|
18
|
+
@pubid3 = "TEST3"
|
19
|
+
@pubid4 = "TEST4"
|
20
|
+
@sysid4 = "urn:x-henrikmartensson.org:test4"
|
21
|
+
@pubid5 = "TEST5"
|
22
|
+
@sysid5 = "urn:x-henrikmartensson.org:test5"
|
23
|
+
@pubid6 = "TEST6"
|
24
|
+
@sysid6 = "urn:x-henrikmartensson.org:test6"
|
25
|
+
@sysid7 = "urn:x-henrikmartensson.org:test7"
|
26
|
+
doc_string = <<-"XMLEND"
|
13
27
|
<!DOCTYPE r SYSTEM "urn:x-henrikmartensson:test" [
|
14
|
-
<!NOTATION n1 PUBLIC "
|
15
|
-
<!NOTATION n2 PUBLIC "
|
16
|
-
<!NOTATION n3 PUBLIC '
|
17
|
-
<!NOTATION n4 PUBLIC '
|
18
|
-
<!NOTATION n5 PUBLIC "
|
19
|
-
<!NOTATION n6 PUBLIC '
|
20
|
-
<!NOTATION n7 SYSTEM "
|
28
|
+
<!NOTATION n1 PUBLIC "#{@pubid1}">
|
29
|
+
<!NOTATION n2 PUBLIC "#{@pubid2}" "#{@sysid2}">
|
30
|
+
<!NOTATION n3 PUBLIC '#{@pubid3}'>
|
31
|
+
<!NOTATION n4 PUBLIC '#{@pubid4}' '#{@sysid4}'>
|
32
|
+
<!NOTATION n5 PUBLIC "#{@pubid5}" '#{@sysid5}'>
|
33
|
+
<!NOTATION n6 PUBLIC '#{@pubid6}' "#{@sysid6}">
|
34
|
+
<!NOTATION n7 SYSTEM "#{@sysid7}">
|
21
35
|
]>
|
22
36
|
<r/>
|
23
37
|
XMLEND
|
24
38
|
@doctype = REXML::Document.new(doc_string).doctype
|
25
39
|
end
|
26
40
|
|
41
|
+
def test_name
|
42
|
+
assert_equal('n1', @doctype.notation('n1').name)
|
43
|
+
end
|
44
|
+
|
27
45
|
def test_public
|
28
|
-
assert_equal(
|
29
|
-
assert_equal(
|
30
|
-
assert_equal(
|
31
|
-
assert_equal(
|
46
|
+
assert_equal(@pubid1, @doctype.notation('n1').public)
|
47
|
+
assert_equal(@pubid2, @doctype.notation('n2').public)
|
48
|
+
assert_equal(@pubid3, @doctype.notation('n3').public)
|
49
|
+
assert_equal(@pubid4, @doctype.notation('n4').public)
|
32
50
|
# The TEST5 and TEST6 assertions have been commented out because
|
33
51
|
# REXML 3.1.2 does not parse the notations correctly.
|
34
|
-
#assert_equal(
|
35
|
-
#assert_equal(
|
52
|
+
#assert_equal(@pubid5, @doctype.notation('n5').public)
|
53
|
+
#assert_equal(@pubid6, @doctype.notation('n6').public)
|
36
54
|
assert_nil(@doctype.notation('n7').public)
|
37
55
|
end
|
38
56
|
|
39
57
|
def test_system
|
40
|
-
assert_equal(
|
58
|
+
assert_equal(@sysid2, @doctype.notation('n2').system)
|
41
59
|
assert_nil(@doctype.notation('n3').system)
|
42
|
-
assert_equal(
|
60
|
+
assert_equal(@sysid4, @doctype.notation('n4').system)
|
43
61
|
# The TEST5 and TEST6 assertions have been commented out because
|
44
62
|
# REXML 3.1.2 does not parse the notations correctly.
|
45
|
-
#assert_equal(
|
46
|
-
#assert_equal(
|
47
|
-
assert_equal(
|
63
|
+
#assert_equal(@sysid5, @doctype.notation('n5').system)
|
64
|
+
#assert_equal(@sysid6, @doctype.notation('n6').system)
|
65
|
+
assert_equal(@sysid7, @doctype.notation('n7').system)
|
48
66
|
end
|
49
67
|
|
50
68
|
end
|
data/test/tc_testunitxml.rb
CHANGED
@@ -290,5 +290,26 @@ class TestTestUnitXml < Test::Unit::TestCase
|
|
290
290
|
check_assertion_failure(string1, string3)
|
291
291
|
check_assertion_failure(string4, string5)
|
292
292
|
end
|
293
|
+
|
294
|
+
def test_xml_not_equal
|
295
|
+
assert_xml_not_equal(@element1, @element2)
|
296
|
+
assert_xml_not_equal(@element1, @element3)
|
297
|
+
assert_xml_not_equal(@element1, @element4)
|
298
|
+
assert_xml_not_equal(@element1, @element5)
|
299
|
+
end
|
300
|
+
|
301
|
+
def test_entity_in_attribute
|
302
|
+
# This test was propmpted by a bug report from
|
303
|
+
# Paul Battley
|
304
|
+
xml_string = '<root text="This & that"/>'
|
305
|
+
doc_original = REXML::Document.new(xml_string)
|
306
|
+
doc_clone = doc_original.dup
|
307
|
+
assert_xml_equal(doc_original, doc_clone)
|
308
|
+
|
309
|
+
xml_different = '<root text="this & that"/>'
|
310
|
+
doc_different = REXML::Document.new(xml_different)
|
311
|
+
assert_xml_not_equal(doc_original, doc_different)
|
312
|
+
end
|
313
|
+
|
293
314
|
|
294
315
|
end
|
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.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.1.5
|
7
|
+
date: 2006-04-18 00:00:00 +02:00
|
8
8
|
summary: Unit test suite for XML documents
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- docs/html/files/lib/test/unit
|
49
49
|
- docs/html/files/lib/test/unit/xml_rb.html
|
50
50
|
- docs/html/files/lib/test/unit/xml
|
51
|
+
- docs/html/files/lib/test/unit/xml/conditionals_rb.html
|
51
52
|
- docs/html/files/lib/test/unit/xml/xmlequalfilter_rb.html
|
52
53
|
- docs/html/files/lib/test/unit/xml/nodeiterator_rb.html
|
53
54
|
- docs/html/files/lib/test/unit/xml/attributes_mixin_rb.html
|
@@ -79,23 +80,29 @@ files:
|
|
79
80
|
- docs/html/classes/Test/Unit/XML.html
|
80
81
|
- docs/html/classes/Test/Unit/TestCase.html
|
81
82
|
- docs/html/classes/Test/Unit/XML.src/M000009.html
|
83
|
+
- docs/html/classes/Test/Unit/XML.src/M000010.html
|
84
|
+
- docs/html/classes/Test/Unit/XML/Conditionals.src
|
82
85
|
- docs/html/classes/Test/Unit/XML/NodeIterator.src
|
83
86
|
- docs/html/classes/Test/Unit/XML/NodeIterator
|
84
87
|
- docs/html/classes/Test/Unit/XML/XmlEqualFilter.src
|
88
|
+
- docs/html/classes/Test/Unit/XML/Conditionals.html
|
85
89
|
- docs/html/classes/Test/Unit/XML/NodeIterator.html
|
86
90
|
- docs/html/classes/Test/Unit/XML/XmlEqualFilter.html
|
87
|
-
- docs/html/classes/Test/Unit/XML/
|
88
|
-
- docs/html/classes/Test/Unit/XML/
|
89
|
-
- docs/html/classes/Test/Unit/XML/NodeIterator.src/M000012.html
|
91
|
+
- docs/html/classes/Test/Unit/XML/Conditionals.src/M000011.html
|
92
|
+
- docs/html/classes/Test/Unit/XML/Conditionals.src/M000012.html
|
90
93
|
- docs/html/classes/Test/Unit/XML/NodeIterator.src/M000013.html
|
94
|
+
- docs/html/classes/Test/Unit/XML/NodeIterator.src/M000014.html
|
95
|
+
- docs/html/classes/Test/Unit/XML/NodeIterator.src/M000015.html
|
96
|
+
- docs/html/classes/Test/Unit/XML/NodeIterator.src/M000016.html
|
91
97
|
- docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src
|
92
98
|
- docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.html
|
93
|
-
- docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/
|
94
|
-
- docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/
|
99
|
+
- docs/html/classes/Test/Unit/XML/NodeIterator/NullNodeFilter.src/M000017.html
|
100
|
+
- docs/html/classes/Test/Unit/XML/XmlEqualFilter.src/M000018.html
|
95
101
|
- lib/test
|
96
102
|
- lib/test/unit
|
97
103
|
- lib/test/unit/xml
|
98
104
|
- lib/test/unit/xml.rb
|
105
|
+
- lib/test/unit/xml/conditionals.rb
|
99
106
|
- lib/test/unit/xml/xmlequalfilter.rb
|
100
107
|
- lib/test/unit/xml/nodeiterator.rb
|
101
108
|
- lib/test/unit/xml/attributes_mixin.rb
|
@@ -103,9 +110,11 @@ files:
|
|
103
110
|
- lib/test/unit/xml/doctype_mixin.rb
|
104
111
|
- lib/test/unit/xml/notationdecl_mixin.rb
|
105
112
|
- test/data
|
113
|
+
- test/tc_attributes_mixin.rb
|
106
114
|
- test/tc_testunitxml.rb
|
107
115
|
- test/tc_notationdecl_mixin.rb
|
108
116
|
- test/ts_testunitxml.rb
|
117
|
+
- test/tc_doctype_mixin.rb
|
109
118
|
- test/data/test1.xml
|
110
119
|
test_files:
|
111
120
|
- test/ts_testunitxml.rb
|