mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/rexml/test_document.rb: Fix tests that expect encoding name
isn't normalized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c420f8449e
commit
82aef2ae50
2 changed files with 9 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Nov 3 13:46:49 2012 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* test/rexml/test_document.rb: Fix tests that expect encoding name
|
||||||
|
isn't normalized.
|
||||||
|
|
||||||
Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
|
Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
* dir.c (Dir#glob):
|
* dir.c (Dir#glob):
|
||||||
|
|
|
@ -167,13 +167,12 @@ EOX
|
||||||
ie_hack = false
|
ie_hack = false
|
||||||
encoding = "Windows-31J"
|
encoding = "Windows-31J"
|
||||||
|
|
||||||
xml_declaration_encoding = "Shift_JIS"
|
@document.xml_decl.encoding = "Shift_JIS"
|
||||||
@document.xml_decl.encoding = xml_declaration_encoding
|
|
||||||
japanese_text = "こんにちは"
|
japanese_text = "こんにちは"
|
||||||
@document.root.text = japanese_text
|
@document.root.text = japanese_text
|
||||||
@document.write(output, indent, transitive, ie_hack, encoding)
|
@document.write(output, indent, transitive, ie_hack, encoding)
|
||||||
assert_equal(<<-EOX.encode(encoding), output)
|
assert_equal(<<-EOX.encode(encoding), output)
|
||||||
<?xml version='1.0' encoding='#{xml_declaration_encoding}'?>
|
<?xml version='1.0' encoding='SHIFT_JIS'?>
|
||||||
<message>#{japanese_text}</message>
|
<message>#{japanese_text}</message>
|
||||||
EOX
|
EOX
|
||||||
end
|
end
|
||||||
|
@ -221,13 +220,12 @@ EOX
|
||||||
def test_encoding
|
def test_encoding
|
||||||
output = ""
|
output = ""
|
||||||
encoding = "Windows-31J"
|
encoding = "Windows-31J"
|
||||||
xml_declaration_encoding = "Shift_JIS"
|
@document.xml_decl.encoding = "Shift_JIS"
|
||||||
@document.xml_decl.encoding = xml_declaration_encoding
|
|
||||||
japanese_text = "こんにちは"
|
japanese_text = "こんにちは"
|
||||||
@document.root.text = japanese_text
|
@document.root.text = japanese_text
|
||||||
@document.write(:output => output, :encoding => encoding)
|
@document.write(:output => output, :encoding => encoding)
|
||||||
assert_equal(<<-EOX.encode(encoding), output)
|
assert_equal(<<-EOX.encode(encoding), output)
|
||||||
<?xml version='1.0' encoding='#{xml_declaration_encoding}'?>
|
<?xml version='1.0' encoding='SHIFT_JIS'?>
|
||||||
<message>#{japanese_text}</message>
|
<message>#{japanese_text}</message>
|
||||||
EOX
|
EOX
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue