diff --git a/.rubocop.yml b/.rubocop.yml index fcb1726e..ac3c8300 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -77,7 +77,6 @@ AllCops: - test/test_kramdown.rb - test/test_liquid_renderer.rb - test/test_page.rb - - test/test_redcarpet.rb - test/test_regenerator.rb - test/test_related_posts.rb - test/test_sass.rb diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb index 528bc8a3..7231cff9 100644 --- a/test/test_redcarpet.rb +++ b/test/test_redcarpet.rb @@ -1,4 +1,4 @@ -require 'helper' +require "helper" class TestRedcarpet < JekyllUnitTest context "redcarpet" do @@ -10,11 +10,9 @@ class TestRedcarpet < JekyllUnitTest end @config = { - 'markdown' => 'redcarpet', - 'redcarpet' => { - 'extensions' => [ - 'smart', 'strikethrough', 'filter_html' - ] + "markdown" => "redcarpet", + "redcarpet" => { + "extensions" => %w(smart strikethrough filter_html) } } @@ -22,7 +20,7 @@ class TestRedcarpet < JekyllUnitTest end should "pass redcarpet options" do - assert_equal "

Some Header

", @markdown.convert('# Some Header #').strip + assert_equal "

Some Header

", @markdown.convert("# Some Header #").strip end should "pass redcarpet SmartyPants options" do @@ -30,58 +28,70 @@ class TestRedcarpet < JekyllUnitTest end should "pass redcarpet extensions" do - assert_equal "

deleted

", @markdown.convert('~~deleted~~').strip + assert_equal "

deleted

", @markdown.convert("~~deleted~~").strip end should "pass redcarpet render options" do - assert_equal "

bad code not here: i am bad

", @markdown.convert('**bad code not here**: ').strip + assert_equal "

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' }) + @markdown = Converters::Markdown.new @config.merge( + { "highlighter" => "pygments" } + ) end should "render fenced code blocks with syntax highlighting" do - assert_equal "
puts "Hello world"\n
", @markdown.convert( - <<-EOS + assert_equal "
puts "Hello world"\n
", + @markdown.convert( + <<-EOS ```ruby puts "Hello world" ``` - EOS - ).strip +EOS + ).strip end end context "with rouge enabled" do setup do - @markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'rouge' }) + @markdown = Converters::Markdown.new @config.merge({ "highlighter" => "rouge" }) end should "render fenced code blocks with syntax highlighting" do - assert_equal "
puts \"Hello world\"\n
", @markdown.convert( - <<-EOS + assert_equal "
puts \"Hello world\"\n
", + @markdown.convert( + <<-EOS ```ruby puts "Hello world" ``` EOS - ).strip + ).strip end end context "without any highlighter" do setup do - @markdown = Converters::Markdown.new @config.merge({ 'highlighter' => nil }) + @markdown = Converters::Markdown.new @config.merge({ "highlighter" => nil }) end should "render fenced code blocks without syntax highlighting" do - assert_equal "
puts "Hello world"\n
", @markdown.convert( - <<-EOS + assert_equal "
puts "Hello world"\n
"\ + "
", + @markdown.convert( + <<-EOS ```ruby puts "Hello world" ``` EOS - ).strip + ).strip end end end