added tests for full path leak to source directory when using include tag

This commit is contained in:
Jens Nazarenus 2014-01-15 21:35:55 +01:00
parent 4c140efba8
commit 82bee23bd0
1 changed files with 19 additions and 0 deletions

View File

@ -487,6 +487,25 @@ CONTENT
end
end
context "include missing file" do
setup do
@content = <<CONTENT
---
title: missing file
---
{% include missing.html %}
CONTENT
end
should "raise error relative to source directory" do
exception = assert_raise IOError do
create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
end
assert_equal 'Included file \'_includes/missing.html\' not found', exception.message
end
end
context "include tag with variable and liquid filters" do
setup do
stub(Jekyll).configuration do