summaryrefslogtreecommitdiff
path: root/test/rexml/test_document.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml/test_document.rb')
-rw-r--r--test/rexml/test_document.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index e8ca2e1c24..72d0ff696f 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -159,6 +159,19 @@ EOX
document.write(output, indent, transitive, ie_hack)
assert_equal("<empty />", output)
end
+
+ def test_encoding
+ output = ""
+ indent = -1
+ transitive = false
+ ie_hack = false
+ encoding = "Shift_JIS"
+ @document.write(output, indent, transitive, ie_hack, encoding)
+ assert_equal(<<-EOX, output)
+<?xml version='1.0' encoding='SHIFT_JIS'?>
+<message>Hello world!</message>
+EOX
+ end
end
class OptionsTest < self
@@ -199,6 +212,15 @@ EOX
document.write(:output => output, :ie_hack => true)
assert_equal("<empty />", output)
end
+
+ def test_encoding
+ output = ""
+ @document.write(:output => output, :encoding => "Shift_JIS")
+ assert_equal(<<-EOX, output)
+<?xml version='1.0' encoding='SHIFT_JIS'?>
+<message>Hello world!</message>
+EOX
+ end
end
end
end