mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
fix rdoc tests for 3.10
This commit is contained in:
parent
bee190b42e
commit
3d78b5ee6c
2 changed files with 7 additions and 3 deletions
|
@ -69,7 +69,11 @@ class Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_body(value)
|
||||
assert_equal value.lstrip.gsub(/\s*\n\s*/, ""), body.lstrip.gsub(/\s*\n\s*/, "")
|
||||
if value.respond_to? :to_str
|
||||
assert_equal value.lstrip.gsub(/\s*\n\s*/, ""), body.lstrip.gsub(/\s*\n\s*/, "")
|
||||
else
|
||||
assert_match value, body
|
||||
end
|
||||
end
|
||||
|
||||
def assert_status(expected)
|
||||
|
|
|
@ -16,13 +16,13 @@ class RdocTest < Test::Unit::TestCase
|
|||
it 'renders inline rdoc strings' do
|
||||
rdoc_app { rdoc '= Hiya' }
|
||||
assert ok?
|
||||
assert_body "<h1>Hiya</h1>"
|
||||
assert_body /<h1[^>]*>Hiya<\/h1>/
|
||||
end
|
||||
|
||||
it 'renders .rdoc files in views path' do
|
||||
rdoc_app { rdoc :hello }
|
||||
assert ok?
|
||||
assert_body "<h1>Hello From RDoc</h1>"
|
||||
assert_body /<h1[^>]*>Hello From RDoc<\/h1>/
|
||||
end
|
||||
|
||||
it "raises error if template not found" do
|
||||
|
|
Loading…
Add table
Reference in a new issue