OLD | NEW |
(Empty) | |
| 1 import 'package:path/path.dart' as p; |
| 2 import 'package:scheduled_test/scheduled_test.dart'; |
| 3 import '../descriptor.dart' as d; |
| 4 import '../serve/utils.dart'; |
| 5 import '../test_pub.dart'; |
| 6 main() { |
| 7 initConfig(); |
| 8 setUp(() { |
| 9 d.dir( |
| 10 appPath, |
| 11 [ |
| 12 d.appPubspec(), |
| 13 d.dir( |
| 14 "web", |
| 15 [ |
| 16 d.dir("one", [d.dir("inner", [d.file("file.txt", "one")])]), |
| 17 d.dir("two", [d.dir("inner", [d.file("file.txt", "two")])]), |
| 18 d.dir("nope", [d.dir("inner", [d.file("file.txt", "nope")])]
)])]).create(); |
| 19 }); |
| 20 var webOne = p.join("web", "one"); |
| 21 var webTwoInner = p.join("web", "two", "inner"); |
| 22 integration("builds subdirectories", () { |
| 23 schedulePub( |
| 24 args: ["build", webOne, webTwoInner], |
| 25 output: new RegExp(r'Built 2 files to "build".')); |
| 26 d.dir( |
| 27 appPath, |
| 28 [ |
| 29 d.dir( |
| 30 "build", |
| 31 [ |
| 32 d.dir( |
| 33 "web", |
| 34 [ |
| 35 d.dir("one", [d.dir("inner", [d.file("file.txt", "on
e")])]), |
| 36 d.dir("two", [d.dir("inner", [d.file("file.txt", "tw
o")])]), |
| 37 d.nothing("nope")])])]).validate(); |
| 38 }); |
| 39 integration("serves subdirectories", () { |
| 40 pubServe(args: [webOne, webTwoInner]); |
| 41 requestShouldSucceed("inner/file.txt", "one", root: webOne); |
| 42 requestShouldSucceed("file.txt", "two", root: webTwoInner); |
| 43 expectNotServed("web"); |
| 44 expectNotServed(p.join("web", "three")); |
| 45 endPubServe(); |
| 46 }); |
| 47 } |
OLD | NEW |