summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-01-25 23:58:30 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-26 17:29:17 +0800
commit3b0f952ec810c08eac01ce2377dfbb252026760b (patch)
tree4de6f87853b2ee290174f67ffce8f73e8251e7d1 /test
parenta86d4eef4b4551a48a5329bb993c3c6c39a1b1f3 (diff)
[ruby/rdoc] Support nesting text page URL
RDoc::Servlet#documentation_page replaces "/" in URL with "::" for class or module but it's also used for the replaced name on text pages. This causes a bug when text pages are in nesting directory. This commit fixes #615. https://github.com/ruby/rdoc/commit/d73b915b1e
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_servlet.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_servlet.rb b/test/rdoc/test_rdoc_servlet.rb
index a3d4246229..b772eeaddf 100644
--- a/test/rdoc/test_rdoc_servlet.rb
+++ b/test/rdoc/test_rdoc_servlet.rb
@@ -232,6 +232,18 @@ class TestRDocServlet < RDoc::TestCase
assert_match %r%<body [^>]+ class="file">%, @res.body
end
+ def test_documentation_page_page_with_nesting
+ store = RDoc::Store.new
+
+ generator = @s.generator_for store
+
+ readme = store.add_file 'nesting/README.rdoc', parser: RDoc::Parser::Simple
+
+ @s.documentation_page store, generator, 'nesting/README_rdoc.html', @req, @res
+
+ assert_equal 200, @res.status
+ end
+
def test_documentation_source
store, path = @s.documentation_source '/ruby/Object.html'