# File lib/listen/adapter.rb, line 213
    def self.works?(directory, options = {})
      work      = false
      test_file = "#{directory}/.listen_test"
      callback  = lambda { |*| work = true }
      adapter   = self.new(directory, options, &callback)
      adapter.start

      FileUtils.touch(test_file)

      t = Thread.new { sleep(adapter.latency * 5); adapter.stop }

      adapter.wait_for_callback
      work
    ensure
      Thread.kill(t) if t
      FileUtils.rm(test_file, :force => true)
      adapter.stop if adapter && adapter.started?
    end