1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Upgrade to RDoc 3.5.3. Fixes [Bug #4376]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-02-07 07:07:12 +00:00
parent ca9f7009db
commit 60f2c9cf5b
11 changed files with 204 additions and 34 deletions

View file

@ -49,6 +49,26 @@ class TestRDocEncoding < MiniTest::Unit::TestCase
assert_equal "hi \u00e9verybody", contents.sub("\r", '')
end
def test_class_read_file_encoding_fail
skip "Encoding not implemented" unless Object.const_defined? :Encoding
@tempfile.write "# coding: utf-8\n\317\200" # pi
@tempfile.flush
# FIXME 1.9 fix on windoze
expected.gsub!("\n", "\r\n") if RUBY_VERSION =~ /^1.9/ && RUBY_PLATFORM =~ /mswin|mingw/
contents = :junk
_, err = capture_io do
contents = RDoc::Encoding.read_file @tempfile.path, Encoding::US_ASCII
end
assert_nil contents
assert_match %r%^unable to convert%, err
end
def test_class_read_file_encoding_fancy
skip "Encoding not implemented" unless Object.const_defined? :Encoding
@ -66,6 +86,21 @@ class TestRDocEncoding < MiniTest::Unit::TestCase
assert_equal Encoding::UTF_8, contents.encoding
end
def test_class_read_file_encoding_force_transcode
skip "Encoding not implemented" unless Object.const_defined? :Encoding
@tempfile.write "# coding: utf-8\n\317\200" # pi
@tempfile.flush
# FIXME 1.9 fix on windoze
expected.gsub!("\n", "\r\n") if RUBY_VERSION =~ /^1.9/ && RUBY_PLATFORM =~ /mswin|mingw/
contents = RDoc::Encoding.read_file @tempfile.path, Encoding::US_ASCII, true
assert_equal '?', contents
assert_equal Encoding::US_ASCII, contents.encoding
end
def test_class_read_file_encoding_guess
skip "Encoding not implemented" unless Object.const_defined? :Encoding