Skip to content

Commit

Permalink
Make RDoc tests less specific
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Feb 25, 2013
1 parent be40174 commit aaffdb1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/tilt_rdoctemplate_test.rb
Expand Up @@ -12,12 +12,18 @@ class RDocTemplateTest < Test::Unit::TestCase

test "preparing and evaluating the template with #render" do
template = Tilt::RDocTemplate.new { |t| "= Hello World!" }
assert_equal "<h1 id=\"label-Hello+World%21\">Hello World!</h1>", template.render.strip
result = template.render.strip
assert_match /<h1/, result
assert_match />Hello World!</, result
end

test "can be rendered more than once" do
template = Tilt::RDocTemplate.new { |t| "= Hello World!" }
3.times { assert_equal "<h1 id=\"label-Hello+World%21\">Hello World!</h1>", template.render.strip }
3.times do
result = template.render.strip
assert_match /<h1/, result
assert_match />Hello World!</, result
end
end
end
rescue LoadError => boom
Expand Down

0 comments on commit aaffdb1

Please sign in to comment.