test/test_helper.rb in redcarpet-3.1.2 vs test/test_helper.rb in redcarpet-3.2.0

- old
+ new

@@ -7,10 +7,23 @@ require 'nokogiri' require 'redcarpet' require 'redcarpet/render_strip' require 'redcarpet/render_man' +require 'redcarpet/compat' -def html_equal(html_a, html_b) - assert_equal Nokogiri::HTML::DocumentFragment.parse(html_a).to_html, - Nokogiri::HTML::DocumentFragment.parse(html_b).to_html +class Redcarpet::TestCase < Test::Unit::TestCase + def html_equal(html_a, html_b) + assert_equal Nokogiri::HTML::DocumentFragment.parse(html_a).to_html, + Nokogiri::HTML::DocumentFragment.parse(html_b).to_html + end + + def assert_renders(html, markdown) + html_equal html, parser.render(markdown) + end + + private + + def parser + @parser ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML) + end end