Browse files

speed up reloader specs

  • Loading branch information...
1 parent 3523233 commit b422ea6248283172e035577dfa4a71ebabbe30ae @rkh rkh committed Aug 17, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 spec/reloader_spec.rb
View
7 spec/reloader_spec.rb
@@ -61,10 +61,9 @@ def write_app_file(options={})
# needed to change the file's mtime.
def update_file(path, &block)
original_mtime = File.exist?(path) ? File.mtime(path) : Time.at(0)
- begin
- File.open(path, 'w', &block)
- sleep 0.1
- end until original_mtime != File.mtime(path)
+ new_time = original_mtime + 1
+ File.open(path, 'w', &block)
+ File.utime(new_time, new_time, path)
end
# Writes a Sinatra application to a file, requires the file, sets

0 comments on commit b422ea6

Please sign in to comment.