test/tilt_markdown_test.rb in tilt-1.3.3 vs test/tilt_markdown_test.rb in tilt-1.3.4

- old
+ new

@@ -24,11 +24,11 @@ def nrender(text, options = {}) html = render(text, options) html.encode!("UTF-8") if html.respond_to?(:encode) normalize(html) end - + def test_escape_html html = nrender "Hello <b>World</b>" assert_equal "<p>Hello <b>World</b></p>", html end @@ -96,12 +96,23 @@ # Doesn't support escaping undef test_escape_html_true def test_smarty_pants_true html = nrender "Hello ``World'' -- This is --- a test ...", :smartypants => true - assert_equal "<p>Hello “World” – This is — a test …</p>", html + assert_equal "<p>Hello “World'' – This is — a test …</p>", html end + + def test_fenced_code_blocks_with_lang + code = <<-COD.gsub(/^\s+/,"") + ```ruby + puts "hello world" + ``` + COD + + html = nrender code, :fenced_code_blocks => true + assert_equal %Q{<pre><code class="ruby">puts "hello world"\n</code></pre>}, html + end end rescue LoadError => boom # It should already be warned in the main tests end @@ -131,11 +142,11 @@ end rescue LoadError => boom # It should already be warned in the main tests end - + begin require 'maruku' class MarkdownMarukuTest < Test::Unit::TestCase include MarkdownTests @@ -153,9 +164,9 @@ rescue LoadError => boom # It should already be warned in the main tests end rescue LoadError - warn "Markdown tests need Nokogiri\n" + warn "Markdown tests need Nokogiri" end