diff options
author | Xavier Noria <fxn@hashref.com> | 2015-11-08 21:10:47 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-11-08 22:49:51 -0800 |
commit | dda54de48ccf72caa447b251986c65d032d81bba (patch) | |
tree | e3350598b841c8bb0441d0d077ffe31f67895b2a /activesupport/test | |
parent | e97200405ec83ee9575cd01e53cd3c4872f05016 (diff) | |
download | rails-dda54de48ccf72caa447b251986c65d032d81bba.tar.gz rails-dda54de48ccf72caa447b251986c65d032d81bba.tar.bz2 rails-dda54de48ccf72caa447b251986c65d032d81bba.zip |
encapsulate sleep margin when touching files
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/file_update_checker_with_enumerable_test_cases.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activesupport/test/file_update_checker_with_enumerable_test_cases.rb b/activesupport/test/file_update_checker_with_enumerable_test_cases.rb index fe19e617fa..4ae6e8c5e2 100644 --- a/activesupport/test/file_update_checker_with_enumerable_test_cases.rb +++ b/activesupport/test/file_update_checker_with_enumerable_test_cases.rb @@ -7,11 +7,16 @@ module FileUpdateCheckerWithEnumerableTestCases # noop end + def touch(files) + sleep 1 + super + end + def setup @tmpdir = Dir.mktmpdir @files = %w(foo.rb bar.rb baz.rb).map {|f| "#{@tmpdir}/#{f}"} - touch(@files) + FileUtils.touch(@files) end def teardown @@ -41,7 +46,6 @@ module FileUpdateCheckerWithEnumerableTestCases checker = new_checker(@files) { i += 1 } - sleep 1 touch(@files) wait @@ -82,7 +86,6 @@ module FileUpdateCheckerWithEnumerableTestCases checker = new_checker(@files) { i += 1 } - sleep 1 touch(@files[1..-1]) wait @@ -96,7 +99,6 @@ module FileUpdateCheckerWithEnumerableTestCases checker = new_checker(@files) { i += 1 } assert !checker.updated? - sleep 1 touch(@files) wait @@ -110,7 +112,6 @@ module FileUpdateCheckerWithEnumerableTestCases checker = new_checker([], @tmpdir => :rb) { i += 1 } - sleep 1 touch(@files) wait |