Add test for processing of symlinked static files and pages
This commit is contained in:
parent
58f64e8269
commit
0bebe0f31c
|
@ -0,0 +1 @@
|
||||||
|
../css
|
|
@ -0,0 +1 @@
|
||||||
|
../index.html
|
|
@ -206,12 +206,26 @@ class TestSite < Test::Unit::TestCase
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
site.read_directories("symlink-test")
|
||||||
|
assert_equal [], site.pages
|
||||||
|
assert_equal [], site.static_files
|
||||||
|
|
||||||
stub(File).symlink?('symlink.js') {true}
|
stub(File).symlink?('symlink.js') {true}
|
||||||
files = %w[symlink.js]
|
files = %w[symlink.js]
|
||||||
assert_equal [], site.filter_entries(files)
|
assert_equal [], site.filter_entries(files)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not filter symlink entries when safe mode disabled" do
|
should "not filter symlink entries when safe mode disabled" do
|
||||||
|
stub(Jekyll).configuration do
|
||||||
|
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => false})
|
||||||
|
end
|
||||||
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
site.read_directories("symlink-test")
|
||||||
|
assert_not_equal [], site.pages
|
||||||
|
assert_not_equal [], site.static_files
|
||||||
|
|
||||||
stub(File).symlink?('symlink.js') {true}
|
stub(File).symlink?('symlink.js') {true}
|
||||||
files = %w[symlink.js]
|
files = %w[symlink.js]
|
||||||
assert_equal files, @site.filter_entries(files)
|
assert_equal files, @site.filter_entries(files)
|
||||||
|
|
Loading…
Reference in New Issue