RDoc::TestCase is an abstract TestCase to provide common setup and teardown across all RDoc tests. The test case uses minitest, so all the assertions of minitest may be used.
The testcase provides the following:
A reset code-object tree
A reset markup preprocessor (RDoc::Markup::PreProcess)
The @RM alias of RDoc::Markup (for less typing)
@pwd containing the current working directory
FileUtils, pp, Tempfile, Dir.tmpdir and StringIO
Abstract test-case setup
# File lib/rdoc/test_case.rb, line 31 def setup super @top_level = nil @RM = RDoc::Markup RDoc::RDoc.reset RDoc::Markup::PreProcess.reset @pwd = Dir.pwd end
Creates a temporary directory changes the current directory to it for the duration of the block.
Depends upon Dir.mktmpdir
# File lib/rdoc/test_case.rb, line 58 def temp_dir skip "No Dir::mktmpdir, upgrade your ruby" unless Dir.respond_to? :mktmpdir Dir.mktmpdir do |temp_dir| Dir.chdir temp_dir do yield temp_dir end end end
Generated with the Darkfish Rdoc Generator 2.
Creates an RDoc::Comment with text which was defined on top_level. By default the comment has the 'rdoc' format.