OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS 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 import 'package:path/path.dart' as p; | |
6 import 'package:scheduled_test/scheduled_test.dart'; | |
7 | |
8 import '../descriptor.dart' as d; | |
9 import '../serve/utils.dart'; | |
10 import '../test_pub.dart'; | |
11 | |
12 main() { | |
13 initConfig(); | |
14 | |
15 setUp(() { | |
16 d.dir(appPath, [ | |
17 d.appPubspec(), | |
18 d.dir("web", [ | |
19 d.dir("one", [ | |
20 d.dir("inner", [d.file("file.txt", "one")]) | |
21 ]), | |
22 d.dir("two", [ | |
23 d.dir("inner", [d.file("file.txt", "two")]) | |
24 ]), | |
25 d.dir("nope", [ | |
26 d.dir("inner", [d.file("file.txt", "nope")]) | |
27 ]) | |
28 ]) | |
29 ]).create(); | |
30 }); | |
31 | |
32 var webOne = p.join("web", "one"); | |
33 var webTwoInner = p.join("web", "two", "inner"); | |
34 | |
35 integration("builds subdirectories", () { | |
36 schedulePub(args: ["build", webOne, webTwoInner], | |
37 output: new RegExp(r'Built 2 files to "build".')); | |
38 | |
39 d.dir(appPath, [ | |
40 d.dir("build", [ | |
41 d.dir("web", [ | |
42 d.dir("one", [ | |
43 d.dir("inner", [d.file("file.txt", "one")]) | |
44 ]), | |
45 d.dir("two", [ | |
46 d.dir("inner", [d.file("file.txt", "two")]) | |
47 ]), | |
48 d.nothing("nope") | |
49 ]) | |
50 ]) | |
51 ]).validate(); | |
52 }); | |
53 | |
54 integration("serves subdirectories", () { | |
55 pubServe(args: [webOne, webTwoInner]); | |
56 | |
57 requestShouldSucceed("inner/file.txt", "one", root: webOne); | |
58 requestShouldSucceed("file.txt", "two", root: webTwoInner); | |
59 expectNotServed("web"); | |
60 expectNotServed(p.join("web", "three")); | |
61 | |
62 endPubServe(); | |
63 }); | |
64 } | |
OLD | NEW |