Merge branch 'master' of github.com:mojombo/jekyll
* 'master' of github.com:mojombo/jekyll: Update history to reflect merge of #1116 Removed space characters in empty lines
This commit is contained in:
commit
fa1cbb7708
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
### Minor Enhancements
|
### Minor Enhancements
|
||||||
* Move the building of related posts into their own class (#1057)
|
* Move the building of related posts into their own class (#1057)
|
||||||
|
* Removed trailing spaces in several places throughout the code (#1116)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
* Rename Jekyll::Logger to Jekyll::Stevenson to fix inheritance issue (#1106)
|
* Rename Jekyll::Logger to Jekyll::Stevenson to fix inheritance issue (#1106)
|
||||||
|
|
|
@ -2,7 +2,7 @@ Feature: Draft Posts
|
||||||
As a hacker who likes to blog
|
As a hacker who likes to blog
|
||||||
I want to be able to preview drafts locally
|
I want to be able to preview drafts locally
|
||||||
In order to see if they look alright before publishing
|
In order to see if they look alright before publishing
|
||||||
|
|
||||||
Scenario: Preview a draft
|
Scenario: Preview a draft
|
||||||
Given I have a configuration file with "permalink" set to "none"
|
Given I have a configuration file with "permalink" set to "none"
|
||||||
And I have a _drafts directory
|
And I have a _drafts directory
|
||||||
|
|
|
@ -117,7 +117,7 @@ Feature: Post data
|
||||||
When I run jekyll
|
When I run jekyll
|
||||||
Then the _site directory should exist
|
Then the _site directory should exist
|
||||||
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
|
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
|
||||||
|
|
||||||
Scenario: Use post.categories variable when category is in YAML and is mixed-case
|
Scenario: Use post.categories variable when category is in YAML and is mixed-case
|
||||||
Given I have a _posts directory
|
Given I have a _posts directory
|
||||||
And I have a _layouts directory
|
And I have a _layouts directory
|
||||||
|
@ -128,7 +128,7 @@ Feature: Post data
|
||||||
When I run jekyll
|
When I run jekyll
|
||||||
Then the _site directory should exist
|
Then the _site directory should exist
|
||||||
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
|
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
|
||||||
|
|
||||||
Scenario: Use post.categories variable when category is in YAML
|
Scenario: Use post.categories variable when category is in YAML
|
||||||
Given I have a _posts directory
|
Given I have a _posts directory
|
||||||
And I have a _layouts directory
|
And I have a _layouts directory
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<h1 class="title"><a href="/">{{ site.name }}</a></h1>
|
<h1 class="title"><a href="/">{{ site.name }}</a></h1>
|
||||||
<a class="extra" href="/">home</a>
|
<a class="extra" href="/">home</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="title">
|
<div class="title">
|
||||||
Tom Preston-Werner
|
Tom Preston-Werner
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ class TestPage < Test::Unit::TestCase
|
||||||
assert_equal "/about/", @page.dir
|
assert_equal "/about/", @page.dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with specified layout of nil" do
|
context "with specified layout of nil" do
|
||||||
setup do
|
setup do
|
||||||
@page = setup_page('sitemap.xml')
|
@page = setup_page('sitemap.xml')
|
||||||
|
|
|
@ -139,7 +139,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
|
assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with specified layout of nil" do
|
context "with specified layout of nil" do
|
||||||
setup do
|
setup do
|
||||||
file = '2013-01-12-nil-layout.textile'
|
file = '2013-01-12-nil-layout.textile'
|
||||||
|
@ -422,7 +422,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
post = setup_post("2009-01-27-empty-categories.textile")
|
post = setup_post("2009-01-27-empty-categories.textile")
|
||||||
assert_equal [], post.categories
|
assert_equal [], post.categories
|
||||||
end
|
end
|
||||||
|
|
||||||
should "recognize number category in yaml" do
|
should "recognize number category in yaml" do
|
||||||
post = setup_post("2013-05-10-number-category.textile")
|
post = setup_post("2013-05-10-number-category.textile")
|
||||||
assert post.categories.include?('2013')
|
assert post.categories.include?('2013')
|
||||||
|
@ -440,7 +440,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
assert post.tags.include?('cooking')
|
assert post.tags.include?('cooking')
|
||||||
assert post.tags.include?('pizza')
|
assert post.tags.include?('pizza')
|
||||||
end
|
end
|
||||||
|
|
||||||
should "recognize empty tag in yaml" do
|
should "recognize empty tag in yaml" do
|
||||||
post = setup_post("2009-05-18-empty-tag.textile")
|
post = setup_post("2009-05-18-empty-tag.textile")
|
||||||
assert_equal [], post.tags
|
assert_equal [], post.tags
|
||||||
|
@ -528,46 +528,46 @@ class TestPost < Test::Unit::TestCase
|
||||||
assert_equal ['foo'], post.categories
|
assert_equal ['foo'], post.categories
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "converter file extension settings" do
|
context "converter file extension settings" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "process .md as markdown under default configuration" do
|
should "process .md as markdown under default configuration" do
|
||||||
post = setup_post '2011-04-12-md-extension.md'
|
post = setup_post '2011-04-12-md-extension.md'
|
||||||
conv = post.converter
|
conv = post.converter
|
||||||
assert conv.kind_of? Jekyll::Converters::Markdown
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
||||||
end
|
end
|
||||||
|
|
||||||
should "process .text as identity under default configuration" do
|
should "process .text as identity under default configuration" do
|
||||||
post = setup_post '2011-04-12-text-extension.text'
|
post = setup_post '2011-04-12-text-extension.text'
|
||||||
conv = post.converter
|
conv = post.converter
|
||||||
assert conv.kind_of? Jekyll::Converters::Identity
|
assert conv.kind_of? Jekyll::Converters::Identity
|
||||||
end
|
end
|
||||||
|
|
||||||
should "process .text as markdown under alternate configuration" do
|
should "process .text as markdown under alternate configuration" do
|
||||||
@site.config['markdown_ext'] = 'markdown,mdw,mdwn,md,text'
|
@site.config['markdown_ext'] = 'markdown,mdw,mdwn,md,text'
|
||||||
post = setup_post '2011-04-12-text-extension.text'
|
post = setup_post '2011-04-12-text-extension.text'
|
||||||
conv = post.converter
|
conv = post.converter
|
||||||
assert conv.kind_of? Jekyll::Converters::Markdown
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
||||||
end
|
end
|
||||||
|
|
||||||
should "process .md as markdown under alternate configuration" do
|
should "process .md as markdown under alternate configuration" do
|
||||||
@site.config['markdown_ext'] = 'markdown,mkd,mkdn,md,text'
|
@site.config['markdown_ext'] = 'markdown,mkd,mkdn,md,text'
|
||||||
post = setup_post '2011-04-12-text-extension.text'
|
post = setup_post '2011-04-12-text-extension.text'
|
||||||
conv = post.converter
|
conv = post.converter
|
||||||
assert conv.kind_of? Jekyll::Converters::Markdown
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
||||||
end
|
end
|
||||||
|
|
||||||
should "process .text as textile under alternate configuration" do
|
should "process .text as textile under alternate configuration" do
|
||||||
@site.config['textile_ext'] = 'textile,text'
|
@site.config['textile_ext'] = 'textile,text'
|
||||||
post = setup_post '2011-04-12-text-extension.text'
|
post = setup_post '2011-04-12-text-extension.text'
|
||||||
conv = post.converter
|
conv = post.converter
|
||||||
assert conv.kind_of? Jekyll::Converters::Textile
|
assert conv.kind_of? Jekyll::Converters::Textile
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ class TestRedCloth < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@textile = Converters::Textile.new
|
@textile = Converters::Textile.new
|
||||||
end
|
end
|
||||||
|
|
||||||
should "preserve single line breaks in HTML output" do
|
should "preserve single line breaks in HTML output" do
|
||||||
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
||||||
end
|
end
|
||||||
|
@ -19,7 +19,7 @@ class TestRedCloth < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
@textile = Converters::Textile.new config
|
@textile = Converters::Textile.new config
|
||||||
end
|
end
|
||||||
|
|
||||||
should "preserve single line breaks in HTML output" do
|
should "preserve single line breaks in HTML output" do
|
||||||
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
||||||
end
|
end
|
||||||
|
@ -34,7 +34,7 @@ class TestRedCloth < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
@textile = Converters::Textile.new config
|
@textile = Converters::Textile.new config
|
||||||
end
|
end
|
||||||
|
|
||||||
should "preserve single line breaks in HTML output" do
|
should "preserve single line breaks in HTML output" do
|
||||||
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
||||||
end
|
end
|
||||||
|
|
|
@ -195,7 +195,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
@site.exclude = excludes + ["exclude*"]
|
@site.exclude = excludes + ["exclude*"]
|
||||||
assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
|
assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not filter entries within include" do
|
should "not filter entries within include" do
|
||||||
includes = %w[_index.html .htaccess include*]
|
includes = %w[_index.html .htaccess include*]
|
||||||
files = %w[index.html _index.html .htaccess includeA]
|
files = %w[index.html _index.html .htaccess includeA]
|
||||||
|
@ -284,7 +284,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
File.open(dest_dir('.svn/HEAD'), 'w')
|
File.open(dest_dir('.svn/HEAD'), 'w')
|
||||||
File.open(dest_dir('.hg/HEAD'), 'w')
|
File.open(dest_dir('.hg/HEAD'), 'w')
|
||||||
end
|
end
|
||||||
|
|
||||||
teardown do
|
teardown do
|
||||||
FileUtils.rm_f(dest_dir('obsolete.html'))
|
FileUtils.rm_f(dest_dir('obsolete.html'))
|
||||||
FileUtils.rm_rf(dest_dir('qux'))
|
FileUtils.rm_rf(dest_dir('qux'))
|
||||||
|
@ -293,7 +293,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
FileUtils.rm_rf(dest_dir('.svn'))
|
FileUtils.rm_rf(dest_dir('.svn'))
|
||||||
FileUtils.rm_rf(dest_dir('.hg'))
|
FileUtils.rm_rf(dest_dir('.hg'))
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'remove orphaned files in destination' do
|
should 'remove orphaned files in destination' do
|
||||||
@site.process
|
@site.process
|
||||||
assert !File.exist?(dest_dir('obsolete.html'))
|
assert !File.exist?(dest_dir('obsolete.html'))
|
||||||
|
@ -317,7 +317,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
assert File.exist?(dest_dir('.svn/HEAD'))
|
assert File.exist?(dest_dir('.svn/HEAD'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an invalid markdown processor in the configuration' do
|
context 'with an invalid markdown processor in the configuration' do
|
||||||
should 'not throw an error at initialization time' do
|
should 'not throw an error at initialization time' do
|
||||||
bad_processor = 'not a processor name'
|
bad_processor = 'not a processor name'
|
||||||
|
@ -325,7 +325,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'throw FatalException at process time' do
|
should 'throw FatalException at process time' do
|
||||||
bad_processor = 'not a processor name'
|
bad_processor = 'not a processor name'
|
||||||
s = Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
s = Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
||||||
|
@ -334,6 +334,6 @@ class TestSite < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue