aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/file_update_checker_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-06-29 15:08:08 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-06-29 15:08:08 -0300
commit33192cfa07d82e345910cdb279f15305ad463faa (patch)
tree011ea0f43b4bd821c6949c9ee69ed12858e2e3b1 /activesupport/test/file_update_checker_test.rb
parenta4dd8719e5e730d37a258680e0793c2cb47e0344 (diff)
downloadrails-33192cfa07d82e345910cdb279f15305ad463faa.tar.gz
rails-33192cfa07d82e345910cdb279f15305ad463faa.tar.bz2
rails-33192cfa07d82e345910cdb279f15305ad463faa.zip
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.
Diffstat (limited to 'activesupport/test/file_update_checker_test.rb')
-rw-r--r--activesupport/test/file_update_checker_test.rb5
1 files 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