mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/options.rb: Added --page-dir option for moving pages in
doc/ to the top-level. * lib/rdoc/rdoc.rb: ditto. * test/rdoc/test_rdoc_options.rb: Test for the above. * test/rdoc/test_rdoc_rdoc.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d5ba73e0d9
commit
b65b75bf2c
5 changed files with 107 additions and 1 deletions
|
@ -76,6 +76,7 @@ class TestRDocOptions < RDoc::TestCase
|
|||
'line_numbers' => false,
|
||||
'main_page' => nil,
|
||||
'markup' => 'rdoc',
|
||||
'page_dir' => nil,
|
||||
'rdoc_include' => [],
|
||||
'show_hash' => false,
|
||||
'static_path' => [],
|
||||
|
@ -430,6 +431,43 @@ rdoc_include:
|
|||
assert_equal 'tomdoc', @options.markup
|
||||
end
|
||||
|
||||
def test_parse_page_dir
|
||||
assert_nil @options.page_dir
|
||||
|
||||
out, err = capture_io do
|
||||
@options.parse %W[--page-dir #{Dir.tmpdir}]
|
||||
end
|
||||
|
||||
assert_empty out
|
||||
assert_empty err
|
||||
|
||||
expected =
|
||||
Pathname(Dir.tmpdir).expand_path.relative_path_from @options.root
|
||||
|
||||
assert_equal expected, @options.page_dir
|
||||
assert_equal [Dir.tmpdir], @options.files
|
||||
end
|
||||
|
||||
def test_parse_page_dir_root
|
||||
assert_nil @options.page_dir
|
||||
|
||||
Dir.mktmpdir do |dir|
|
||||
abs_root = dir
|
||||
abs_page_dir = File.join dir, 'pages'
|
||||
FileUtils.mkdir abs_page_dir
|
||||
|
||||
out, err = capture_io do
|
||||
@options.parse %W[--page-dir #{abs_page_dir} --root #{abs_root}]
|
||||
end
|
||||
|
||||
assert_empty out
|
||||
assert_empty err
|
||||
|
||||
assert_equal Pathname('pages'), @options.page_dir
|
||||
assert_equal [abs_page_dir], @options.files
|
||||
end
|
||||
end
|
||||
|
||||
def test_parse_root
|
||||
assert_equal Pathname(Dir.pwd), @options.root
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue