failing test

Signed-off-by: Parker Moore <parkrmoore@gmail.com>
This commit is contained in:
Ben Balter 2014-01-06 19:30:13 -05:00 committed by Parker Moore
parent 750a56d1fe
commit 9e796d0627
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
permalink: /%2e%2e/baddie.html
---
# Test

View File

@ -103,6 +103,15 @@ class TestPost < Test::Unit::TestCase
assert_equal "/my_category/permalinked-post", @post.url assert_equal "/my_category/permalinked-post", @post.url
end end
should "not be writable outside of destination" do
post = setup_post("2014-01-06-permalink-traversal.md")
do_render(post)
post.write(dest_dir)
assert !File.exist?(File.expand_path("../baddie.html", dest_dir))
assert File.exist(File.expand_path("/baddie.html", dest_dir))
end
context "with CRLF linebreaks" do context "with CRLF linebreaks" do
setup do setup do
@real_file = "2009-05-24-yaml-linebreak.markdown" @real_file = "2009-05-24-yaml-linebreak.markdown"