# frozen_string_literal: true require "helper" class TestRedcarpet < JekyllUnitTest context "redcarpet" do setup do if jruby? then skip( "JRuby does not perform well with CExt, test disabled." ) end @config = { "markdown" => "redcarpet", "redcarpet" => { "extensions" => %w(smart strikethrough filter_html), }, } @markdown = Converters::Markdown.new @config @sample = Jekyll::Utils.strip_heredoc(<<-EOS ```ruby puts "Hello world" ``` EOS ) end should "pass redcarpet options" do assert_equal "
“smart”
", @markdown.convert('"smart"').strip end should "pass redcarpet extensions" do assert_equal "deleted
bad code not here: i am bad
", @markdown.convert("**bad code not here**: ").strip end context "with pygments enabled" do setup do @markdown = Converters::Markdown.new @config.merge( { "highlighter" => "pygments" } ) end should "render fenced code blocks with syntax highlighting" do assert_equal( %(puts "Hello world"\n
puts "Hello world"\n