Skip to content

Commit c4d92cc

Browse files
committed
Fix RDoc 6.16+ compatibility by relaxing the check
With RDoc 6.16.0, the following test started to fail: ~~~ 1) Failure: RdocTest#test_renders_inline_rdoc_strings_0 [test/rdoc_test.rb:19]: Expected /<h1[^>]*>Hiya(<span><a href=\"#label-Hiya\">&para;<\/a> <a href=\"#(documentation|top)\">&uarr;<\/a><\/span>)?<\/h1>/ to match # encoding: ASCII-8BIT # valid: true "\n<h1 id=\"label-Hiya\"><a href=\"#label-Hiya\">Hiya</a></h1>\n". 2) Failure: RdocTest#test_renders_rdoc_files_in_views_path_0 [test/rdoc_test.rb:25]: Expected /<h1[^>]*>Hello From RDoc(<span><a href=\"#label-Hello\+From\+RDoc\">&para;<\/a> <a href=\"#(documentation|top)\">&uarr;<\/a><\/span>)?<\/h1>/ to match # encoding: ASCII-8BIT # valid: true "\n<h1 id=\"label-Hello+From+RDoc\"><a href=\"#label-Hello+From+RDoc\">Hello From RDoc</a></h1>\n". ~~~ and it is caused by this change: ruby/rdoc#1465 The error happens due to over-prescriptive RDoc check, it seems. Looking into history, it seems the intention was just to check if RDoc works. However, the check later started to look too much into details of rendering. Therefore, relax the check to look only for know text and basic formatting and leave the rest as RDoc implementation detail. Fixes sinatra#2131
1 parent 4062e36 commit c4d92cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/rdoc_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def rdoc_app(&block)
1616
it 'renders inline rdoc strings' do
1717
rdoc_app { rdoc '= Hiya' }
1818
assert ok?
19-
assert_body(/<h1[^>]*>Hiya(<span><a href=\"#label-Hiya\">&para;<\/a> <a href=\"#(documentation|top)\">&uarr;<\/a><\/span>)?<\/h1>/)
19+
assert_body(/<h1[^>]*>(<.*>)?Hiya(<.*>)?<\/h1>/)
2020
end
2121

2222
it 'renders .rdoc files in views path' do
2323
rdoc_app { rdoc :hello }
2424
assert ok?
25-
assert_body(/<h1[^>]*>Hello From RDoc(<span><a href=\"#label-Hello\+From\+RDoc\">&para;<\/a> <a href=\"#(documentation|top)\">&uarr;<\/a><\/span>)?<\/h1>/)
25+
assert_body(/<h1[^>]*>(<.*>)?Hello From RDoc(<.*>)?<\/h1>/)
2626
end
2727

2828
it "raises error if template not found" do

0 commit comments

Comments
 (0)