aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-02 22:52:57 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-02 22:52:57 +0000
commit488fb86a1eb3307030c8d4c0946ea080205b78f3 (patch)
treec502c54e146284d46d469d62ec03fb74574613bc /test/rdoc
parent28f6b32e7e31017a9ca2bd5497e142a0f5ee7b7c (diff)
downloadruby-488fb86a1eb3307030c8d4c0946ea080205b78f3.tar.gz
* lib/rdoc/parser.rb: Improved modeline support. Patch by nobu.
* test/rdoc/test_rdoc_parser.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_parser.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb
index 628d1bd1da..1058323457 100644
--- a/test/rdoc/test_rdoc_parser.rb
+++ b/test/rdoc/test_rdoc_parser.rb
@@ -1,3 +1,5 @@
+# -*- coding: us-ascii -*-
+
require 'rdoc/test_case'
class TestRDocParser < RDoc::TestCase
@@ -111,6 +113,20 @@ class TestRDocParser < RDoc::TestCase
File.unlink readme_ext
end
+ def test_check_modeline_with_other
+ readme_ext = File.join Dir.tmpdir, "README.EXT.#{$$}"
+
+ open readme_ext, 'w' do |io|
+ io.puts "# README.EXT - -*- mode: RDoc; indent-tabs-mode: nil -*-"
+ io.puts
+ io.puts "This document explains how to make extension libraries for Ruby."
+ end
+
+ assert_equal 'rdoc', @RP.check_modeline(readme_ext)
+ ensure
+ File.unlink readme_ext
+ end
+
def test_check_modeline_no_modeline
readme_ext = File.join Dir.tmpdir, "README.EXT.#{$$}"