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_encoding.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_encoding.rb')
-rw-r--r-- | test/rexml/test_encoding.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/rexml/test_encoding.rb b/test/rexml/test_encoding.rb index 23e4802927..e1f9296821 100644 --- a/test/rexml/test_encoding.rb +++ b/test/rexml/test_encoding.rb @@ -26,7 +26,7 @@ class EncodingTester < Test::Unit::TestCase def test_encoded_in_change_out doc = Document.new( @encoded ) doc.xml_decl.encoding = "UTF-8" - assert_equal( doc.encoding, "UTF-8" ) + assert_equal( ::Encoding::UTF_8, doc.encoding ) REXML::Formatters::Default.new.write( doc.root, out="" ) out.force_encoding('binary') if out.respond_to? :force_encoding assert_equal( @not_encoded, out ) @@ -47,7 +47,7 @@ class EncodingTester < Test::Unit::TestCase def test_in_change_out doc = Document.new( @not_encoded ) doc.xml_decl.encoding = "ISO-8859-3" - assert_equal( doc.encoding, "ISO-8859-3" ) + assert_equal( ::Encoding::ISO_8859_3, doc.encoding ) doc.write( out="" ) out.force_encoding('binary') if out.respond_to? :force_encoding assert_equal( @encoded, out ) @@ -86,7 +86,7 @@ class EncodingTester < Test::Unit::TestCase def test_ticket_110 utf16 = REXML::Document.new(File.new(fixture_path("ticket_110_utf16.xml"))) - assert_equal( "UTF-16", utf16.encoding ) + assert_equal( ::Encoding::UTF_16BE, utf16.encoding ) assert( utf16[0].kind_of?(REXML::XMLDecl)) end end |