| 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 superdirectory is unbound it is still watched because " | |
| 16 "the subdirectory 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: [exampleOne, "example"]); | |
| 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": "example"}, { | |
| 34 "url": getServerUrl("example") | |
| 35 }); | |
| 36 | |
| 37 // "example" should not be served now. | |
| 38 requestShouldNotConnect("one/foo.txt", root: "example"); | |
| 39 | |
| 40 // "example/one" is still fine. | |
| 41 requestShouldSucceed("foo.txt", "before", root: exampleOne); | |
| 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("foo.txt", "after", root: exampleOne); | |
| 55 | |
| 56 endPubServe(); | |
| 57 }); | |
| 58 } | |
| OLD | NEW |