test/test_kramdown.rb in markdown-1.0.0 vs test/test_kramdown.rb in markdown-1.1.0

- old
+ new

@@ -1,35 +1,44 @@ ### # NB: for local testing run like: # -# 1.8.x: ruby -Ilib -rrubygems test/test_kramdown.rb # 1.9.x: ruby -Ilib test/test_kramdown.rb # core and stlibs -require 'test/unit' -require 'logger' -require 'pp' +require 'helper' -# our own code -require 'lib/markdown' - -class TestKramdown < Test::Unit::TestCase +class TestKramdown < MiniTest::Unit::TestCase def setup + puts 'enter setup' + lib = Markdown.lib + puts ' set lib=kramdown' Markdown.lib = 'kramdown' end - + def test_lib lib = Markdown.lib - assert_equal( 'kramdown', lib ) + assert_equal( 'kramdown', lib ) end - - def test_to_html - html = Markdown.new( 'Hello World!' ).to_html - assert_equal( "<p>Hello World!</p>\n", html ) + + def test_to_html_banner_false + md = Markdown.new( 'Hello World!', banner: false ) + + assert_equal( "<p>Hello World!</p>\n", md.to_html ) + assert_equal( "<p>Hello World!</p>\n", md.to_html ) + assert_equal( "<p>Hello World!</p>\n", md.to_html ) end - -end # class TestKramdown \ No newline at end of file + def test_to_html_banner_true + md = Markdown.new( 'Hello World!', banner: true ) + html1 = md.to_html + html2 = md.to_html + assert( html1 =~ /^<!-- === begin markdown block ===/ ) + assert( html1.include?( "<p>Hello World!</p>\n" )) + assert( html2.include?( "<p>Hello World!</p>\n" )) + assert( html1 =~ /============ -->$/ ) + end + +end # class TestKramdown