Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding failing test for UTF-8 pygments issue GH-8

  • Loading branch information...
commit 6342a3842c0eace8989bf365d8f8c99c252dd051 1 parent ccbd2c3
@qrush qrush authored
Showing with 35 additions and 19 deletions.
  1. +35 −19 test/test_tags.rb
View
54 test/test_tags.rb
@@ -1,35 +1,51 @@
require File.dirname(__FILE__) + '/helper'
class TestTags < Test::Unit::TestCase
- context "tagging" do
- setup do
- @content = <<CONTENT
+
+ def create_post(code)
+ stub(Jekyll).configuration do
+ Jekyll::DEFAULTS.merge({'pygments' => true})
+ end
+ site = Site.new(Jekyll.configuration)
+ info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
+
+ content = <<CONTENT
---
-layout: post
title: This is a test
-
---
-This document results in a markdown error with maruku
-{% highlight ruby %}
-puts "hi"
+This document results in a markdown error with maruku
-puts "bye"
+{% highlight text %}
+#{code}
{% endhighlight %}
-
CONTENT
+
+ @result = Liquid::Template.parse(content).render({}, info)
+ @result = site.markdown(@result)
+ end
+
+ context "post content has highlight tag" do
+ setup do
+ create_post("test")
+ end
+
+ should "not cause a markdown error" do
+ assert_no_match /markdown\-html\-error/, @result
+ end
+
+ should "render markdown with pygments line handling" do
+ assert_match %{<pre>test\n</pre>}, @result
+ end
+ end
+
+ context "post content has highlight tag with UTF character" do
+ setup do
+ create_post("Æ")
end
should "render markdown with pygments line handling" do
- stub(Jekyll).configuration do
- Jekyll::DEFAULTS.merge({'pygments' => true})
- end
- site = Site.new(Jekyll.configuration)
- info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
-
- result = Liquid::Template.parse(@content).render({}, info)
- result = site.markdown(result)
- assert_no_match(/markdown\-html\-error/,result)
+ assert_match %{<pre>Æ\n</pre>}, @result
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.