aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_encoding.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
commitd42d6e690e3f553b971322eae783ac6b0d4d9692 (patch)
tree2004bf4517ee7b81466c300cf30092e62e65467e /test/rdoc/test_rdoc_encoding.rb
parent670c6e8ce9d4a12bb4832e10fab27365398649bf (diff)
downloadruby-d42d6e690e3f553b971322eae783ac6b0d4d9692.tar.gz
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_encoding.rb')
-rw-r--r--test/rdoc/test_rdoc_encoding.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_encoding.rb b/test/rdoc/test_rdoc_encoding.rb
index f50e2f6012..7ec39f8a9c 100644
--- a/test/rdoc/test_rdoc_encoding.rb
+++ b/test/rdoc/test_rdoc_encoding.rb
@@ -131,6 +131,23 @@ class TestRDocEncoding < RDoc::TestCase
assert_equal "hi everybody", content, bug3360
end
+ def test_class_read_file_encoding_iso_2022_jp
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
+
+ input = "# coding: ISO-2022-JP\n:\e$B%3%^%s%I\e(B:"
+
+ @tempfile.write input
+ @tempfile.flush
+
+ contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8
+
+ expected = ":\xe3\x82\xb3\xe3\x83\x9e\xe3\x83\xb3\xe3\x83\x89:"
+ expected.force_encoding Encoding::UTF_8
+
+ assert_equal expected, contents
+ assert_equal Encoding::UTF_8, contents.encoding
+ end
+
def test_class_set_encoding
s = "# coding: UTF-8\n"
RDoc::Encoding.set_encoding s