test/test_redcarpet.rb in jekyll-1.5.1 vs test/test_redcarpet.rb in jekyll-2.0.0.alpha.1

- old
+ new

@@ -26,11 +26,11 @@ 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 context "with pygments enabled" do setup do - @markdown = Converters::Markdown.new @config.merge({ 'pygments' => true }) + @markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'pygments' }) end should "render fenced code blocks with syntax highlighting" do assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\" data-lang=\"ruby\"><span class=\"nb\">puts</span> <span class=\"s2\">&quot;Hello world&quot;</span>\n</code></pre></div>", @markdown.convert( <<-EOS @@ -40,12 +40,28 @@ EOS ).strip end end - context "with pygments disabled" do + context "with rouge enabled" do setup do - @markdown = Converters::Markdown.new @config.merge({ 'pygments' => false }) + @markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'rouge' }) + end + + should "render fenced code blocks with syntax highlighting" do + assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\" data-lang=\"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 + + context "without any highlighter" do + setup do + @markdown = Converters::Markdown.new @config.merge({ 'highlighter' => nil }) end should "render fenced code blocks without syntax highlighting" do assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\" data-lang=\"ruby\">puts &quot;Hello world&quot;\n</code></pre></div>", @markdown.convert( <<-EOS