Sha256: dc42f543bff5696760d254abfa2da1523ff95a787feed74d3f7171e8ed6d479c
Contents?: true
Size: 1.22 KB
Versions: 2
Compression:
Stored size: 1.22 KB
Contents
require 'helper' class TestRedcarpet < Test::Unit::TestCase context "redcarpet" do setup do config = { 'redcarpet' => { 'extensions' => ['smart', 'strikethrough', 'filter_html'] }, 'markdown' => 'redcarpet' } @markdown = MarkdownConverter.new config end should "pass redcarpet options" do assert_equal "<h1>Some Header</h1>", @markdown.convert('# Some Header #').strip end should "pass redcarpet SmartyPants options" do assert_equal "<p>“smart”</p>", @markdown.convert('"smart"').strip end should "pass redcarpet extensions" do assert_equal "<p><del>deleted</del></p>", @markdown.convert('~~deleted~~').strip end should "pass redcarpet render options" do assert_equal "<p><strong>bad code not here</strong>: i am bad</p>", @markdown.convert('**bad code not here**: <script>i am bad</script>').strip end should "render fenced code blocks" do assert_equal "<div class=\"highlight\"><pre><code class=\"ruby\"><span class=\"nb\">puts</span> <span class=\"s2\">"Hello world"</span>\n</code></pre></div>", @markdown.convert( <<-EOS ```ruby puts "Hello world" ``` EOS ).strip end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jekyll-0.12.1 | test/test_redcarpet.rb |
jekyll-0.12.0 | test/test_redcarpet.rb |