summaryrefslogtreecommitdiff
path: root/test/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-28 12:39:37 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-28 12:39:37 +0000
commita750424cab13cab79de7d7922f32f31be6f415f3 (patch)
tree3626139c7cc4d3fb02dbda3c477a7378fca8bd30 /test/rexml
parent2a42c1bd3a8fcaa59f778070bff0eac60757ced3 (diff)
* test/rexml/test_document.rb: Group tests that they parse
UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/test_document.rb30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index 02e4a69..028fa98 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -225,24 +225,26 @@ EOX
end
class BomTest < self
- def test_utf_16le
- xml = <<-EOX.encode("UTF-16LE").force_encoding("ASCII-8BIT")
+ class HaveEncodingTest < self
+ def test_utf_16le
+ xml = <<-EOX.encode("UTF-16LE").force_encoding("ASCII-8BIT")
<?xml version="1.0" encoding="UTF-16"?>
<message>Hello world!</message>
EOX
- bom = "\ufeff".encode("UTF-16LE").force_encoding("ASCII-8BIT")
- document = REXML::Document.new(bom + xml)
- assert_equal("UTF-16", document.encoding)
- end
+ bom = "\ufeff".encode("UTF-16LE").force_encoding("ASCII-8BIT")
+ document = REXML::Document.new(bom + xml)
+ assert_equal("UTF-16", document.encoding)
+ end
- def test_utf_16be
- xml = <<-EOX.encode("UTF-16BE").force_encoding("ASCII-8BIT")
-<?xml version="1.0" encoding="UTF-16"?>
-<message>Hello world!</message>
-EOX
- bom = "\ufeff".encode("UTF-16BE").force_encoding("ASCII-8BIT")
- document = REXML::Document.new(bom + xml)
- assert_equal("UTF-16", document.encoding)
+ def test_utf_16be
+ xml = <<-EOX.encode("UTF-16BE").force_encoding("ASCII-8BIT")
+ <?xml version="1.0" encoding="UTF-16"?>
+ <message>Hello world!</message>
+ EOX
+ bom = "\ufeff".encode("UTF-16BE").force_encoding("ASCII-8BIT")
+ document = REXML::Document.new(bom + xml)
+ assert_equal("UTF-16", document.encoding)
+ end
end
end
end