diff options
Diffstat (limited to 'test/rdoc')
-rw-r--r-- | test/rdoc/test_rdoc_options.rb | 1 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_rdoc.rb | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb index 5d7135c795..e72489d307 100644 --- a/test/rdoc/test_rdoc_options.rb +++ b/test/rdoc/test_rdoc_options.rb @@ -479,6 +479,7 @@ rdoc_include: assert_empty err assert_equal Pathname(Dir.tmpdir), @options.root + assert_includes @options.rdoc_include, @options.root.to_path end def test_parse_template diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index 28b6a2bb4d..9a13569f01 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -162,6 +162,26 @@ class TestRDocRDoc < RDoc::TestCase end end + def test_parse_file_include_root + @rdoc.store = RDoc::Store.new + + top_level = nil + temp_dir do |dir| + @rdoc.options.parse %W[--root #{File.dirname(__FILE__)}] + + open 'include.txt', 'w' do |io| + io.puts ':include: test.txt' + end + + out, err = capture_io do + top_level = @rdoc.parse_file 'include.txt' + end + assert_empty out + assert_empty err + end + assert_equal "test file", top_level.comment.text + end + def test_parse_file_page_dir @rdoc.store = RDoc::Store.new |