diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-30 12:10:56 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-30 12:10:56 +0000 |
commit | 994f066f76857a781f8819b8da2c2aeceedbf87b (patch) | |
tree | d89e9bcf6ac8d558367f888919de0c4894224063 /test/rexml/test_core.rb | |
parent | 767fe5170d97461be5c79936b467dee3d4eb7179 (diff) | |
download | ruby-994f066f76857a781f8819b8da2c2aeceedbf87b.tar.gz |
* lib/rexml/encoding.rb: use Ruby native encoding mechnism. [ruby-dev:42464]
* lib/rexml/encodings/: remove.
* lib/rexml/document.rb, lib/rexml/formatters/default.rb,
lib/rexml/output.rb, lib/rexml/parseexception.rb,
lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb,
lib/rexml/xmldecl.rb: use Ruby's native Encoding object.
* test/rexml/, test/rss/: follow the above encoding chagnes.
* NEWS: add REXML's incompatible change about encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/test_core.rb')
-rw-r--r-- | test/rexml/test_core.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/rexml/test_core.rb b/test/rexml/test_core.rb index 48a31aee0e..5fae4f54e3 100644 --- a/test/rexml/test_core.rb +++ b/test/rexml/test_core.rb @@ -433,6 +433,11 @@ class Tester < Test::Unit::TestCase assert_equal source, decl2.to_s end + def test_xmldecl_utf_16be_encoding_name + assert_equal("<?xml version='1.0' encoding='UTF-16'?>", + XMLDecl.new("1.0", "UTF-16").to_s) + end + def each_test( element, xpath, num_children ) count = 0 element.each_element( xpath ) { |child| @@ -1123,7 +1128,6 @@ EOL end def test_repeated_writes - require 'iconv' a = IO.read(fixture_path("iso8859-1.xml")) f = REXML::Formatters::Pretty.new @@ -1246,9 +1250,9 @@ EOL def test_ticket_88 doc = REXML::Document.new("<?xml version=\"1.0\" encoding=\"shift_jis\"?>") - assert_equal("<?xml version='1.0' encoding='SHIFT_JIS'?>", doc.to_s) + assert_equal("<?xml version='1.0' encoding='Shift_JIS'?>", doc.to_s) doc = REXML::Document.new("<?xml version = \"1.0\" encoding = \"shift_jis\"?>") - assert_equal("<?xml version='1.0' encoding='SHIFT_JIS'?>", doc.to_s) + assert_equal("<?xml version='1.0' encoding='Shift_JIS'?>", doc.to_s) end def test_ticket_85 |