summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-29 03:05:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-29 03:05:55 +0000
commit5668c8ac5e70f9d7894558a77bb41b65f52173c5 (patch)
tree082d659285e2ad6351f3187fa26551c1d65eeb70 /test/rdoc
parent10e347864d950fa40dd0134e832811c88a5c50d4 (diff)
* lib/rdoc/rdoc.rb (RDoc#read_file_contents): take care of BOM.
[ruby-dev:41452] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index 866667c494..f126bfbdb2 100644
--- a/test/rdoc/test_rdoc_rdoc.rb
+++ b/test/rdoc/test_rdoc_rdoc.rb
@@ -68,6 +68,18 @@ class TestRDocRDoc < MiniTest::Unit::TestCase
assert_equal Encoding::UTF_8, contents.encoding
end
+ def test_read_file_contents_encoding_with_signature
+ skip "Encoding not implemented" unless defined? ::Encoding
+
+ @tempfile.write "\xEF\xBB\xBF""hi everybody"
+ @tempfile.flush
+
+ bug3360 = '[ruby-dev:41452]'
+ contents = @rdoc.read_file_contents @tempfile.path
+ assert_equal "hi everybody", contents, bug3360
+ assert_equal Encoding::UTF_8, contents.encoding, bug3360
+ end
+
def test_remove_unparsable
file_list = %w[
blah.class