mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-10 14:45:38 -05:00
Merge branch 'master' into refactor-related-posts
This commit is contained in:
7
test/source/_posts/2013-05-10-number-category.textile
Normal file
7
test/source/_posts/2013-05-10-number-category.textile
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Number Category in YAML
|
||||
category: 2013
|
||||
---
|
||||
|
||||
Please make me pass
|
||||
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 33, @site.posts.size
|
||||
assert_equal 34, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
||||
@@ -422,6 +422,12 @@ class TestPost < Test::Unit::TestCase
|
||||
post = setup_post("2009-01-27-empty-categories.textile")
|
||||
assert_equal [], post.categories
|
||||
end
|
||||
|
||||
should "recognize number category in yaml" do
|
||||
post = setup_post("2013-05-10-number-category.textile")
|
||||
assert post.categories.include?('2013')
|
||||
assert !post.categories.include?(2013)
|
||||
end
|
||||
|
||||
should "recognize tag in yaml" do
|
||||
post = setup_post("2009-05-18-tag.textile")
|
||||
|
||||
@@ -30,9 +30,9 @@ class TestRedcarpet < Test::Unit::TestCase
|
||||
setup do
|
||||
@markdown = Converters::Markdown.new @config.merge({ 'pygments' => true })
|
||||
end
|
||||
|
||||
|
||||
should "render fenced code blocks with syntax highlighting" do
|
||||
assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\"><span class=\"nb\">puts</span> <span class=\"s2\">"Hello world"</span>\n</code></pre></div>", @markdown.convert(
|
||||
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"
|
||||
@@ -48,7 +48,7 @@ puts "Hello world"
|
||||
end
|
||||
|
||||
should "render fenced code blocks without syntax highlighting" do
|
||||
assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\">puts "Hello world"\n</code></pre></div>", @markdown.convert(
|
||||
assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\" data-lang=\"ruby\">puts "Hello world"\n</code></pre></div>", @markdown.convert(
|
||||
<<-EOS
|
||||
```ruby
|
||||
puts "Hello world"
|
||||
|
||||
@@ -172,7 +172,7 @@ class TestSite < Test::Unit::TestCase
|
||||
|
||||
posts = Dir[source_dir("**", "_posts", "**", "*")]
|
||||
posts.delete_if { |post| File.directory?(post) && !Post.valid?(post) }
|
||||
categories = %w(bar baz category foo z_category publish_test win).sort
|
||||
categories = %w(2013 bar baz category foo z_category publish_test win).sort
|
||||
|
||||
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
||||
assert_equal categories, @site.categories.keys.sort
|
||||
|
||||
Reference in New Issue
Block a user