Skip to content
Browse files

Merge pull request #379 from timfel/support-rdoc-3.10

fix rdoc tests for 3.10
  • Loading branch information...
2 parents f288801 + 3d78b5e commit 5e6322c7dfe4a17b484ae6112a5710045ee23c1e @rkh rkh committed Oct 10, 2011
Showing with 7 additions and 3 deletions.
  1. +5 −1 test/helper.rb
  2. +2 −2 test/rdoc_test.rb
View
6 test/helper.rb
@@ -69,7 +69,11 @@ def body
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)
View
4 test/rdoc_test.rb
@@ -16,13 +16,13 @@ def rdoc_app(&block)
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

0 comments on commit 5e6322c

Please sign in to comment.
Something went wrong with that request. Please try again.