Merge remote branch 'jlecour/master'
Conflicts: lib/jekyll/page.rb
This commit is contained in:
commit
4afee1bda1
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
layout: nil
|
||||||
|
---
|
||||||
|
ErrorDocument 404 /404.html
|
||||||
|
ErrorDocument 500 /500.html
|
||||||
|
{% for post in site.posts %}
|
||||||
|
# {{ post.url }}
|
||||||
|
{% endfor %}
|
||||||
|
|
@ -16,7 +16,7 @@ class TestPage < Test::Unit::TestCase
|
||||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
context "processing pages" do
|
context "processing pages" do
|
||||||
should "create url based on filename" do
|
should "create url based on filename" do
|
||||||
@page = setup_page('contacts.html')
|
@page = setup_page('contacts.html')
|
||||||
|
|
@ -71,7 +71,7 @@ class TestPage < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "write properly" do
|
should "write properly" do
|
||||||
page = setup_page('contacts.html')
|
page = setup_page('contacts.html')
|
||||||
do_render(page)
|
do_render(page)
|
||||||
|
|
@ -83,14 +83,14 @@ class TestPage < Test::Unit::TestCase
|
||||||
|
|
||||||
should "write properly without html extension" do
|
should "write properly without html extension" do
|
||||||
page = setup_page('contacts.html')
|
page = setup_page('contacts.html')
|
||||||
page.site.permalink_style = :pretty
|
page.site.permalink_style = :pretty
|
||||||
do_render(page)
|
do_render(page)
|
||||||
page.write(dest_dir)
|
page.write(dest_dir)
|
||||||
|
|
||||||
assert File.directory?(dest_dir)
|
assert File.directory?(dest_dir)
|
||||||
assert File.exists?(File.join(dest_dir, 'contacts', 'index.html'))
|
assert File.exists?(File.join(dest_dir, 'contacts', 'index.html'))
|
||||||
end
|
end
|
||||||
|
|
||||||
should "write properly with extension different from html" do
|
should "write properly with extension different from html" do
|
||||||
page = setup_page("sitemap.xml")
|
page = setup_page("sitemap.xml")
|
||||||
page.site.permalink_style = :pretty
|
page.site.permalink_style = :pretty
|
||||||
|
|
@ -102,7 +102,16 @@ class TestPage < Test::Unit::TestCase
|
||||||
assert File.directory?(dest_dir)
|
assert File.directory?(dest_dir)
|
||||||
assert File.exists?(File.join(dest_dir,'sitemap.xml'))
|
assert File.exists?(File.join(dest_dir,'sitemap.xml'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "write dotfiles properly" do
|
||||||
|
page = setup_page('.htaccess')
|
||||||
|
do_render(page)
|
||||||
|
page.write(dest_dir)
|
||||||
|
|
||||||
|
assert File.directory?(dest_dir)
|
||||||
|
assert File.exists?(File.join(dest_dir, '.htaccess'))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue