提交 dda54de4 编写于 作者: X Xavier Noria

encapsulate sleep margin when touching files

上级 e9720040
......@@ -7,11 +7,16 @@ def wait
# 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 @@ def test_should_invoke_the_block_if_a_file_has_changed
checker = new_checker(@files) { i += 1 }
sleep 1
touch(@files)
wait
......@@ -82,7 +86,6 @@ def test_should_be_robust_to_handle_files_with_wrong_modified_time
checker = new_checker(@files) { i += 1 }
sleep 1
touch(@files[1..-1])
wait
......@@ -96,7 +99,6 @@ def test_should_cache_updated_result_until_execute
checker = new_checker(@files) { i += 1 }
assert !checker.updated?
sleep 1
touch(@files)
wait
......@@ -110,7 +112,6 @@ def test_should_invoke_the_block_if_a_watched_dir_changes
checker = new_checker([], @tmpdir => :rb) { i += 1 }
sleep 1
touch(@files)
wait
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册