mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
1325437297
* 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
42 lines
894 B
Ruby
42 lines
894 B
Ruby
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 (<i>regexp</i>s) are patterns which describe the
|
|
contents of a string.
|
|
INCLUDE
|
|
|
|
@tempfile.flush
|
|
@tempfile.rewind
|
|
|
|
content = @pp.include_file @name, ''
|
|
|
|
expected = <<-EXPECTED
|
|
Regular expressions (<i>regexp</i>s) are patterns which describe the
|
|
contents of a string.
|
|
EXPECTED
|
|
|
|
assert_equal expected, content
|
|
end
|
|
|
|
end
|
|
|