Add failing test for File.utime of a symlink in staticfile.

This commit is contained in:
Parker Moore 2016-09-28 16:54:58 -07:00
parent 682c0fc98f
commit fd5f2eb399
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,14 @@ class TestStaticFile < JekyllUnitTest
assert_equal Time.new.to_i, @static_file.mtime
end
should "only set modified time if not a symlink" do
expect(File).to receive(:symlink?).and_return(true)
expect(File).not_to receive(:utime)
@static_file.write(dest_dir)
allow(File).to receive(:symlink?).and_call_original
end
should "known if the source path is modified, when it is" do
sleep 1
modify_dummy_file(@filename)