Merge pull request #3220 from inukshuk/patch-1
This commit is contained in:
commit
ce78ea7818
|
@ -81,6 +81,7 @@ module Jekyll
|
|||
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||
FileUtils.rm(dest_path) if File.exist?(dest_path)
|
||||
FileUtils.cp(path, dest_path)
|
||||
File.utime(@@mtimes[path], @@mtimes[path], dest_path)
|
||||
|
||||
true
|
||||
end
|
||||
|
|
|
@ -132,7 +132,6 @@ class TestSite < Test::Unit::TestCase
|
|||
@site.metadata.clear
|
||||
|
||||
@site.process
|
||||
some_static_file = @site.static_files[0].path
|
||||
dest = File.expand_path(@site.static_files[0].destination(@site.dest))
|
||||
mtime1 = File.stat(dest).mtime.to_i # first run must generate dest file
|
||||
|
||||
|
@ -144,16 +143,17 @@ class TestSite < Test::Unit::TestCase
|
|||
|
||||
# simulate destination file deletion
|
||||
File.unlink dest
|
||||
refute File.exists?(dest)
|
||||
|
||||
sleep 1
|
||||
@site.process
|
||||
mtime3 = File.stat(dest).mtime.to_i
|
||||
assert_not_equal mtime2, mtime3 # must be regenerated and differ!
|
||||
assert_equal mtime2, mtime3 # must be regenerated and with original mtime!
|
||||
|
||||
sleep 1
|
||||
@site.process
|
||||
mtime4 = File.stat(dest).mtime.to_i
|
||||
assert_equal mtime3, mtime4 # no modifications, so must be the same
|
||||
assert_equal mtime3, mtime4 # no modifications, so remain the same
|
||||
end
|
||||
|
||||
should "setup plugins in priority order" do
|
||||
|
|
Loading…
Reference in New Issue