Skip to content

Commit

Permalink
Merge remote branch 'jlecour/master'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/jekyll/page.rb
  • Loading branch information
mojombo committed Nov 17, 2010
2 parents 8cc5370 + e9cf7b4 commit 4afee1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions test/source/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: nil
---
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
{% for post in site.posts %}
# {{ post.url }}
{% endfor %}
19 changes: 14 additions & 5 deletions test/test_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def do_render(page)
stub(Jekyll).configuration { Jekyll::DEFAULTS }
@site = Site.new(Jekyll.configuration)
end

context "processing pages" do
should "create url based on filename" do
@page = setup_page('contacts.html')
Expand Down Expand Up @@ -71,7 +71,7 @@ def do_render(page)
setup do
clear_dest
end

should "write properly" do
page = setup_page('contacts.html')
do_render(page)
Expand All @@ -83,14 +83,14 @@ def do_render(page)

should "write properly without html extension" do
page = setup_page('contacts.html')
page.site.permalink_style = :pretty
page.site.permalink_style = :pretty
do_render(page)
page.write(dest_dir)

assert File.directory?(dest_dir)
assert File.exists?(File.join(dest_dir, 'contacts', 'index.html'))
end

should "write properly with extension different from html" do
page = setup_page("sitemap.xml")
page.site.permalink_style = :pretty
Expand All @@ -102,7 +102,16 @@ def do_render(page)
assert File.directory?(dest_dir)
assert File.exists?(File.join(dest_dir,'sitemap.xml'))
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

0 comments on commit 4afee1b

Please sign in to comment.