2 require 'eventmachine'
\r
5 class TestFileWatch < Test::Unit::TestCase
\r
20 EM.kqueue = true if EM.kqueue?
\r
24 EM.kqueue = false if EM.kqueue?
\r
30 file = Tempfile.new('em-watch')
\r
31 $tmp_path = file.path
\r
34 watch = EM.watch_file(file.path, FileWatcher)
\r
38 File.open(file.path, 'w'){ |f| f.puts 'hi' }
\r
41 EM.add_timer(0.25){ file.close; file.delete }
\r
44 assert_equal($path, $tmp_path)
\r