From 16c19ecd190b7cb26e4a4e4f97c204f300a3ce65 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 9 Sep 2010 09:37:51 +0200 Subject: [PATCH] Add a failing test for rendering dotfiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test uses a simple ".htaccess" file that needs to be rendered as any other page, like the sitemap.xml, … --- test/source/.htaccess | 8 ++++++++ test/test_page.rb | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/source/.htaccess diff --git a/test/source/.htaccess b/test/source/.htaccess new file mode 100644 index 00000000..294fb14a --- /dev/null +++ b/test/source/.htaccess @@ -0,0 +1,8 @@ +--- +layout: nil +--- +ErrorDocument 404 /404.html +ErrorDocument 500 /500.html +{% for post in site.posts %} + # {{ post.url }} +{% endfor %} \ No newline at end of file diff --git a/test/test_page.rb b/test/test_page.rb index 6fbb003d..36d38087 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -92,6 +92,15 @@ class TestPage < Test::Unit::TestCase 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