From 33192cfa07d82e345910cdb279f15305ad463faa Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 29 Jun 2012 15:08:08 -0300 Subject: [PATCH] Fix failing test in file update checker Introduced in 1abe31670fdad2c357b4356b40a4567a46d16693 The test was failing when running on isolation, because the extensions were not being loaded, thus 1.year.from_now was failing. Just use mktime instead, adding 1 year to Time.now. --- activesupport/test/file_update_checker_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/activesupport/test/file_update_checker_test.rb b/activesupport/test/file_update_checker_test.rb index 9d5417b70c..bd1df0f858 100644 --- a/activesupport/test/file_update_checker_test.rb +++ b/activesupport/test/file_update_checker_test.rb @@ -50,12 +50,13 @@ class FileUpdateCheckerWithEnumerableTest < ActiveSupport::TestCase def test_should_be_robust_to_handle_files_with_wrong_modified_time i = 0 - time = 1.year.from_now # wrong mtime from the future + now = Time.now + time = Time.mktime(now.year + 1, now.month, now.day) # wrong mtime from the future File.utime time, time, FILES[2] checker = ActiveSupport::FileUpdateChecker.new(FILES){ i += 1 } - sleep(0.1) + sleep(1) FileUtils.touch(FILES[0..1]) assert checker.execute_if_updated