Index: pkg/watcher/test/directory_watcher/mac_os_test.dart |
diff --git a/pkg/watcher/test/directory_watcher/linux_test.dart b/pkg/watcher/test/directory_watcher/mac_os_test.dart |
similarity index 69% |
copy from pkg/watcher/test/directory_watcher/linux_test.dart |
copy to pkg/watcher/test/directory_watcher/mac_os_test.dart |
index ba695698b64c4b7a5e9d6d431343b87db2b638b9..f7f8176ae33385399a75dfd13bf69dc99fea29bd 100644 |
--- a/pkg/watcher/test/directory_watcher/linux_test.dart |
+++ b/pkg/watcher/test/directory_watcher/mac_os_test.dart |
@@ -3,7 +3,7 @@ |
// BSD-style license that can be found in the LICENSE file. |
import 'package:scheduled_test/scheduled_test.dart'; |
-import 'package:watcher/src/directory_watcher/linux.dart'; |
+import 'package:watcher/src/directory_watcher/mac_os.dart'; |
import 'package:watcher/watcher.dart'; |
import 'shared.dart'; |
@@ -12,22 +12,27 @@ import '../utils.dart'; |
main() { |
initConfig(); |
- watcherFactory = (dir) => new LinuxDirectoryWatcher(dir); |
+ watcherFactory = (dir) => new MacOSDirectoryWatcher(dir); |
- setUp(() { |
- // Increase the timeout because closing a [Directory.watch] stream blocks |
- // the main isolate for a very long time on Goobuntu, as of kernel |
- // 3.2.5-gg1336 (see issue 14606). |
- currentSchedule.timeout *= 3; |
- |
- createSandbox(); |
- }); |
+ setUp(createSandbox); |
sharedTests(); |
- test('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux', () { |
+ test('DirectoryWatcher creates a MacOSDirectoryWatcher on Mac OS', () { |
expect(new DirectoryWatcher('.'), |
- new isInstanceOf<LinuxDirectoryWatcher>()); |
+ new isInstanceOf<MacOSDirectoryWatcher>()); |
+ }); |
+ |
+ test('does not notify about the watched directory being deleted and ' |
+ 'recreated immediately before watching', () { |
+ createDir("dir"); |
+ writeFile("dir/old.txt"); |
+ deleteDir("dir"); |
+ createDir("dir"); |
+ |
+ startWatcher(dir: "dir"); |
+ writeFile("dir/newer.txt"); |
+ expectAddEvent("dir/newer.txt"); |
}); |
test('notifies even if the file contents are unchanged', () { |