class RDoc::TestCase
def assert_directory path
def assert_directory path assert File.directory?(path), "#{path} is not a directory" end
def assert_file path
def assert_file path assert File.file?(path), "#{path} is not a file" end
def blank_line
def blank_line @RM::BlankLine.new end
def block *contents
def block *contents @RM::BlockQuote.new(*contents) end
def comment text, top_level = @top_level
def comment text, top_level = @top_level RDoc::Comment.new text, top_level end
def doc *contents
def doc *contents @RM::Document.new(*contents) end
def hard_break
def hard_break @RM::HardBreak.new end
def head level, text
def head level, text @RM::Heading.new level, text end
def item label = nil, *parts
def item label = nil, *parts @RM::ListItem.new label, *parts end
def list type = nil, *items
def list type = nil, *items @RM::List.new type, *items end
def mu_pp obj # :nodoc:
def mu_pp obj # :nodoc: s = obj.pretty_inspect s = RDoc::Encoding.change_encoding s, Encoding.default_external s.chomp end
def para *a
def para *a @RM::Paragraph.new(*a) end
def raw *contents
def raw *contents @RM::Raw.new(*contents) end
def refute_file path
def refute_file path refute File.exist?(path), "#{path} exists" end
def rule weight
def rule weight @RM::Rule.new weight end
def setup
def setup super @top_level = nil @RM = RDoc::Markup RDoc::Markup::PreProcess.reset @pwd = Dir.pwd @store = RDoc::Store.new @rdoc = RDoc::RDoc.new @rdoc.store = @store @rdoc.options = RDoc::Options.new g = Object.new def g.class_dir() end def g.file_dir() end @rdoc.generator = g end
def temp_dir
def temp_dir Dir.mktmpdir do |temp_dir| Dir.chdir temp_dir do yield temp_dir end end end
def verb *parts
def verb *parts @RM::Verbatim.new(*parts) end
def verbose_capture_io
def verbose_capture_io capture_io do begin orig_verbose = $VERBOSE $VERBOSE = true yield ensure $VERBOSE = orig_verbose end end end