aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_markup_pre_process.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
commit60f2c9cf5bea6dd99fac50c460eab4809cc30b01 (patch)
treeab40b4f7be3ff6d9fc8aede6b90e1aa9dded0aff /test/rdoc/test_rdoc_markup_pre_process.rb
parentca9f7009db8aea70af3dd58cb6c7de0010844d22 (diff)
downloadruby-60f2c9cf5bea6dd99fac50c460eab4809cc30b01.tar.gz
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
Diffstat (limited to 'test/rdoc/test_rdoc_markup_pre_process.rb')
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_pre_process.rb b/test/rdoc/test_rdoc_markup_pre_process.rb
index b4db512ce3..0d2e8565be 100644
--- a/test/rdoc/test_rdoc_markup_pre_process.rb
+++ b/test/rdoc/test_rdoc_markup_pre_process.rb
@@ -1,3 +1,5 @@
+# coding: utf-8
+
require 'tempfile'
require 'rubygems'
require 'minitest/autorun'
@@ -46,6 +48,30 @@ contents of a string.
assert_equal expected, content
end
+ def test_include_file_encoding_incompatible
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
+
+ @tempfile.write <<-INCLUDE
+# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
+
+ INCLUDE
+
+ @tempfile.flush
+ @tempfile.rewind
+
+ content = @pp.include_file @file_name, '', Encoding::US_ASCII
+
+ expected = "?\n"
+
+ # FIXME 1.9 fix on windoze
+ # preprocessor uses binread, so line endings are \r\n
+ expected.gsub!("\n", "\r\n") if
+ RUBY_VERSION =~ /^1.9/ && RUBY_PLATFORM =~ /mswin|mingw/
+
+ assert_equal expected, content
+ end
+
def test_handle
text = "# :x: y\n"
out = @pp.handle text