diff options
Diffstat (limited to 'activesupport/test/file_update_checker_shared_tests.rb')
-rw-r--r-- | activesupport/test/file_update_checker_shared_tests.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/file_update_checker_shared_tests.rb b/activesupport/test/file_update_checker_shared_tests.rb index 5207860a0e..12e67a1e9f 100644 --- a/activesupport/test/file_update_checker_shared_tests.rb +++ b/activesupport/test/file_update_checker_shared_tests.rb @@ -134,6 +134,22 @@ module FileUpdateCheckerSharedTests assert_equal 1, i end + test 'should return max_time for files with mtime = Time.at(0)' do + i = 0 + + FileUtils.touch(tmpfiles) + + time = Time.at(0) # wrong mtime from the future + File.utime(time, time, tmpfiles[0]) + + checker = new_checker(tmpfiles) { i += 1 } + + touch(tmpfiles[1..-1]) + + assert checker.execute_if_updated + assert_equal 1, i + end + test 'should cache updated result until execute' do i = 0 |