| 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:scheduled_test/scheduled_test.dart'; | |
| 6 | |
| 7 import '../descriptor.dart' as d; | |
| 8 import '../serve/utils.dart'; | |
| 9 import '../test_pub.dart'; | |
| 10 | |
| 11 main() { | |
| 12 initConfig(); | |
| 13 | |
| 14 setUp(() { | |
| 15 d.dir( | |
| 16 appPath, | |
| 17 [ | |
| 18 d.appPubspec(), | |
| 19 d.dir('benchmark', [d.file('file.txt', 'benchmark')]), | |
| 20 d.dir('bin', [d.file('file.txt', 'bin')]), | |
| 21 d.dir('example', [d.file('file.txt', 'example')]), | |
| 22 d.dir('test', [d.file('file.txt', 'test')]), | |
| 23 d.dir('web', [d.file('file.txt', 'web')]), | |
| 24 d.dir('unknown', [d.file('file.txt', 'unknown')])]).create(); | |
| 25 }); | |
| 26 | |
| 27 integration("build --all finds assets in default source directories", () { | |
| 28 schedulePub( | |
| 29 args: ["build", "--all"], | |
| 30 output: new RegExp(r'Built 5 files to "build".')); | |
| 31 | |
| 32 d.dir( | |
| 33 appPath, | |
| 34 [ | |
| 35 d.dir( | |
| 36 'build', | |
| 37 [ | |
| 38 d.dir('benchmark', [d.file('file.txt', 'benchmark')]), | |
| 39 d.dir('bin', [d.file('file.txt', 'bin')]), | |
| 40 d.dir('example', [d.file('file.txt', 'example')]), | |
| 41 d.dir('test', [d.file('file.txt', 'test')]), | |
| 42 d.dir('web', [d.file('file.txt', 'web')]), | |
| 43 // Only includes default source directories. | |
| 44 d.nothing('unknown')])]).validate(); | |
| 45 }); | |
| 46 | |
| 47 integration("serve --all finds assets in default source directories", () { | |
| 48 pubServe(args: ["--all"]); | |
| 49 | |
| 50 requestShouldSucceed("file.txt", "benchmark", root: "benchmark"); | |
| 51 requestShouldSucceed("file.txt", "bin", root: "bin"); | |
| 52 requestShouldSucceed("file.txt", "example", root: "example"); | |
| 53 requestShouldSucceed("file.txt", "test", root: "test"); | |
| 54 requestShouldSucceed("file.txt", "web", root: "web"); | |
| 55 | |
| 56 expectNotServed("unknown"); | |
| 57 | |
| 58 endPubServe(); | |
| 59 }); | |
| 60 } | |
| OLD | NEW |