| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library pub_tests; | |
| 6 | |
| 7 import 'package:path/path.dart' as p; | |
| 8 | |
| 9 import '../../descriptor.dart' as d; | |
| 10 import '../../test_pub.dart'; | |
| 11 import '../utils.dart'; | |
| 12 | |
| 13 main() { | |
| 14 initConfig(); | |
| 15 integration("when a subdirectory is unbound it is still watched because the " | |
| 16 "superdirectory is watching it", () { | |
| 17 d.dir(appPath, [ | |
| 18 d.appPubspec(), | |
| 19 d.dir("example", [ | |
| 20 d.dir("one", [ | |
| 21 d.file("foo.txt", "before") | |
| 22 ]) | |
| 23 ]) | |
| 24 ]).create(); | |
| 25 | |
| 26 var exampleOne = p.join("example", "one"); | |
| 27 pubServe(args: ["example", exampleOne]); | |
| 28 | |
| 29 requestShouldSucceed("one/foo.txt", "before", root: "example"); | |
| 30 requestShouldSucceed("foo.txt", "before", root: exampleOne); | |
| 31 | |
| 32 // Unbind the subdirectory. | |
| 33 expectWebSocketResult("unserveDirectory", {"path": exampleOne}, { | |
| 34 "url": getServerUrl(exampleOne) | |
| 35 }); | |
| 36 | |
| 37 // "example/one" should not be served now. | |
| 38 requestShouldNotConnect("foo.txt", root: exampleOne); | |
| 39 | |
| 40 // "example" is still fine. | |
| 41 requestShouldSucceed("one/foo.txt", "before", root: "example"); | |
| 42 | |
| 43 // And still being watched. | |
| 44 d.dir(appPath, [ | |
| 45 d.appPubspec(), | |
| 46 d.dir("example", [ | |
| 47 d.dir("one", [ | |
| 48 d.file("foo.txt", "after") | |
| 49 ]) | |
| 50 ]) | |
| 51 ]).create(); | |
| 52 | |
| 53 waitForBuildSuccess(); | |
| 54 requestShouldSucceed("one/foo.txt", "after", root: "example"); | |
| 55 | |
| 56 endPubServe(); | |
| 57 }); | |
| 58 } | |
| OLD | NEW |