aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 04:46:06 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 04:46:06 +0000
commitbdbc8c5b74b0b17da710c9f174a920e4c8b3cb02 (patch)
tree0f1f1672dbc832dd5f95ce52f6a89019c141cbd0 /test
parent4aca275e9c0778eafed9a54467e5446cebac48fe (diff)
downloadruby-bdbc8c5b74b0b17da710c9f174a920e4c8b3cb02.tar.gz
Revert r37439 and r37441
r37439: * lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encoding module because XMLDecl doesn't convert encoding. This causes removing XML encoding name normalization (encoding.upcase). Encoding name in XML declaration is what user specifies. I think this is reasonable change. * test/rexml/test_xml_declaration.rb: Add tests for the above change. r37441: * test/rexml/test_core.rb (Tester#test_ticket_88): Follow the change that encoding name in XML declaration isn't normalized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rexml/test_core.rb4
-rw-r--r--test/rexml/test_xml_declaration.rb12
2 files changed, 2 insertions, 14 deletions
diff --git a/test/rexml/test_core.rb b/test/rexml/test_core.rb
index bbc23d608c..e530cc16c6 100644
--- a/test/rexml/test_core.rb
+++ b/test/rexml/test_core.rb
@@ -1312,9 +1312,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
diff --git a/test/rexml/test_xml_declaration.rb b/test/rexml/test_xml_declaration.rb
index 16427c7d1a..d58f9f08ba 100644
--- a/test/rexml/test_xml_declaration.rb
+++ b/test/rexml/test_xml_declaration.rb
@@ -31,16 +31,4 @@ class TestXmlDeclaration < Test::Unit::TestCase
assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling)
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
end
-
- def test_equal
- lower_encoding_xml_decl = REXML::XMLDecl.new("1.0", "utf-8")
- upper_encoding_xml_decl = REXML::XMLDecl.new("1.0", "UTF-8")
- assert_equal(lower_encoding_xml_decl, upper_encoding_xml_decl)
- end
-
- def test_encoding_is_not_normalized
- lower_encoding_xml_decl = REXML::XMLDecl.new("1.0", "utf-8")
- assert_equal("<?xml version='1.0' encoding='utf-8'?>",
- lower_encoding_xml_decl.to_s)
- end
end