mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
Merge remote-tracking branch 'derekprior/configurable_coverter_file_extensions'
This commit is contained in:
7
test/source/_posts/2011-04-12-md-extension.md
Normal file
7
test/source/_posts/2011-04-12-md-extension.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
date: 2011-04-12 13:07:09
|
||||
---
|
||||
|
||||
under default configuration, this post should get processed by the identity converter. By changing
|
||||
textile extension or markdown extension configuration parameters, you should be able to associate
|
||||
it with either of those converters
|
||||
0
test/source/_posts/2011-04-12-text-extension.text
Normal file
0
test/source/_posts/2011-04-12-text-extension.text
Normal file
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 26, @site.posts.size
|
||||
assert_equal 28, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
||||
@@ -397,6 +397,47 @@ class TestPost < Test::Unit::TestCase
|
||||
post = Post.new(@site, File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile')
|
||||
assert_equal ['foo'], post.categories
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "converter file extension settings" do
|
||||
setup do
|
||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
||||
@site = Site.new(Jekyll.configuration)
|
||||
end
|
||||
|
||||
should "process .md as markdown under default configuration" do
|
||||
post = setup_post '2011-04-12-md-extension.md'
|
||||
conv = post.converter
|
||||
assert conv.kind_of? Jekyll::MarkdownConverter
|
||||
end
|
||||
|
||||
should "process .text as indentity under default configuration" do
|
||||
post = setup_post '2011-04-12-text-extension.text'
|
||||
conv = post.converter
|
||||
assert conv.kind_of? Jekyll::IdentityConverter
|
||||
end
|
||||
|
||||
should "process .text as markdown under alternate configuration" do
|
||||
@site.config['markdown_ext'] = 'markdown,mdw,mdwn,md,text'
|
||||
post = setup_post '2011-04-12-text-extension.text'
|
||||
conv = post.converter
|
||||
assert conv.kind_of? Jekyll::MarkdownConverter
|
||||
end
|
||||
|
||||
should "process .md as markdown under alternate configuration" do
|
||||
@site.config['markdown_ext'] = 'markdown,mkd,mkdn,md,text'
|
||||
post = setup_post '2011-04-12-text-extension.text'
|
||||
conv = post.converter
|
||||
assert conv.kind_of? Jekyll::MarkdownConverter
|
||||
end
|
||||
|
||||
should "process .text as textile under alternate configuration" do
|
||||
@site.config['textile_ext'] = 'textile,text'
|
||||
post = setup_post '2011-04-12-text-extension.text'
|
||||
conv = post.converter
|
||||
assert conv.kind_of? Jekyll::TextileConverter
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user