Merge pull request #824 from sinamt/symlinked_folders

Allow symlinked folders in unsafe mode (with tests). Closes #796, resolves #233.
This commit is contained in:
Parker Moore
2013-02-26 16:54:52 -08:00
2 changed files with 18 additions and 2 deletions

View File

@@ -172,6 +172,22 @@ class TestSite < Test::Unit::TestCase
assert_equal files, @site.filter_entries(files)
end
should "filter symlink entries when safe mode enabled" do
stub(Jekyll).configuration do
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
end
site = Site.new(Jekyll.configuration)
stub(File).symlink?('symlink.js') {true}
files = %w[symlink.js]
assert_equal [], site.filter_entries(files)
end
should "not filter symlink entries when safe mode disabled" do
stub(File).symlink?('symlink.js') {true}
files = %w[symlink.js]
assert_equal files, @site.filter_entries(files)
end
context 'error handling' do
should "raise if destination is included in source" do
stub(Jekyll).configuration do