Index: pkg/watcher/test/directory_watcher/windows_test.dart |
diff --git a/pkg/watcher/test/directory_watcher/windows_test.dart b/pkg/watcher/test/directory_watcher/windows_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e9a854a9f78bb321852e9a5b1cdd0f68d1461b8 |
--- /dev/null |
+++ b/pkg/watcher/test/directory_watcher/windows_test.dart |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+import 'package:path/path.dart' as p; |
+import 'package:scheduled_test/scheduled_test.dart'; |
+import 'package:watcher/src/directory_watcher/windows.dart'; |
+import 'package:watcher/watcher.dart'; |
+ |
+import 'shared.dart'; |
+import '../utils.dart'; |
+ |
+main() { |
+ initConfig(); |
+ |
+ watcherFactory = (dir) => new WindowsDirectoryWatcher(dir); |
+ |
+ setUp(createSandbox); |
+ |
+ sharedTests(); |
+ |
+ test('DirectoryWatcher creates a WindowsDirectoryWatcher on Windows', () { |
+ expect(new DirectoryWatcher('.'), |
+ new isInstanceOf<WindowsDirectoryWatcher>()); |
+ }); |
+ |
+ test('when the watched directory is moved, removes all files', () { |
Bob Nystrom
2014/06/04 15:48:29
Huh, I'm surprised we aren't already testing this
Anders Johnsen
2014/06/10 06:47:15
Done.
|
+ writeFile("dir/a.txt"); |
+ writeFile("dir/b.txt"); |
+ |
+ startWatcher(dir: "dir"); |
+ |
+ renameDir("dir", "moved_dir"); |
Søren Gjesse
2014/06/04 10:04:52
I assume that the sandbox takes care of deleting t
Anders Johnsen
2014/06/04 10:15:53
Yes.
|
+ createDir("dir"); |
+ inAnyOrder([ |
+ isRemoveEvent("dir/a.txt"), |
+ isRemoveEvent("dir/b.txt") |
+ ]); |
+ }); |
+} |
+ |