# -*- coding: utf-8 -*- require File.dirname(__FILE__) + '/helper' class TestTags < Test::Unit::TestCase def create_post(content, override = {}, markdown = true) stub(Jekyll).configuration do Jekyll::DEFAULTS.merge({'pygments' => true}).merge(override) end site = Site.new(Jekyll.configuration) info = { :filters => [Jekyll::Filters], :registers => { :site => site } } if markdown payload = {"content_type" => "markdown"} else payload = {"content_type" => "textile"} end @result = Liquid::Template.parse(content).render(payload, info) if markdown @result = Engines.markdown(@result) else @result = Engines.textile(@result) end end def fill_post(code, override = {}) content = <test\n}, @result end end context "post content has highlight tag with UTF character" do setup do fill_post("Æ") end should "render markdown with pygments line handling" do assert_match %{
Æ\n
}, @result end end context "simple post with markdown and pre tags" do setup do @content = <
}, @result end end context "using Maruku" do setup do create_post(@content) end should "parse correctly" do assert_match %r{FIGHT!}, @result assert_match %r{FINISH HIM}, @result end end context "using RDiscount" do setup do create_post(@content, 'markdown' => 'rdiscount') end should "parse correctly" do assert_match %r{FIGHT!}, @result assert_match %r{FINISH HIM}, @result end end end end