mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user