aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-11-08 21:10:47 -0800
committerXavier Noria <fxn@hashref.com>2015-11-08 22:49:51 -0800
commitdda54de48ccf72caa447b251986c65d032d81bba (patch)
treee3350598b841c8bb0441d0d077ffe31f67895b2a /activesupport/test
parente97200405ec83ee9575cd01e53cd3c4872f05016 (diff)
downloadrails-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.rb11
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