Refactor directory watcher tests