From 1325437297539bf433904b64db63a3186e62177e Mon Sep 17 00:00:00 2001 From: drbrain Date: Sat, 10 Apr 2010 06:36:13 +0000 Subject: * lib/rdoc: Import RDoc 2.5.2 * lib/rdoc/parser/ruby.rb (RDoc::Parser::Ruby): Don't parse rdoc files, reverts r24976 in favor of include directive support in C parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_markup_pre_process.rb | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 test/rdoc/test_rdoc_markup_pre_process.rb (limited to 'test/rdoc/test_rdoc_markup_pre_process.rb') diff --git a/test/rdoc/test_rdoc_markup_pre_process.rb b/test/rdoc/test_rdoc_markup_pre_process.rb new file mode 100644 index 0000000000..5f1b22db4d --- /dev/null +++ b/test/rdoc/test_rdoc_markup_pre_process.rb @@ -0,0 +1,42 @@ +require 'tempfile' +require 'rubygems' +require 'minitest/autorun' +require 'rdoc/markup/preprocess' + +class TestRDocMarkupPreProcess < MiniTest::Unit::TestCase + + def setup + @tempfile = Tempfile.new 'test_rdoc_markup_pre_process' + @name = File.basename @tempfile.path + @dir = File.dirname @tempfile.path + + @pp = RDoc::Markup::PreProcess.new __FILE__, [@dir] + end + + def teardown + @tempfile.close + end + + def test_include_file + @tempfile.write <<-INCLUDE +# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*- + +Regular expressions (regexps) are patterns which describe the +contents of a string. + INCLUDE + + @tempfile.flush + @tempfile.rewind + + content = @pp.include_file @name, '' + + expected = <<-EXPECTED +Regular expressions (regexps) are patterns which describe the +contents of a string. + EXPECTED + + assert_equal expected, content + end + +end + -- cgit v1.2.3