| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 | 6 |
| 7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
| 8 import '../serve/utils.dart'; | 8 import '../serve/utils.dart'; |
| 9 import '../test_pub.dart'; | 9 import '../test_pub.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 setUp(() { | 12 setUp(() { |
| 13 d.dir(appPath, [ | 13 d.dir(appPath, [ |
| 14 d.appPubspec(), | 14 d.appPubspec(), |
| 15 d.dir('benchmark', [d.file('file.txt', 'benchmark')]), | 15 d.dir('benchmark', [d.file('file.txt', 'benchmark')]), |
| 16 d.dir('bin', [d.file('file.txt', 'bin')]), | 16 d.dir('bin', [d.file('file.txt', 'bin')]), |
| 17 d.dir('example', [d.file('file.txt', 'example')]), | 17 d.dir('example', [d.file('file.txt', 'example')]), |
| 18 d.dir('test', [d.file('file.txt', 'test')]), | 18 d.dir('test', [d.file('file.txt', 'test')]), |
| 19 d.dir('web', [d.file('file.txt', 'web')]), | 19 d.dir('web', [d.file('file.txt', 'web')]), |
| 20 d.dir('unknown', [d.file('file.txt', 'unknown')]) | 20 d.dir('unknown', [d.file('file.txt', 'unknown')]) |
| 21 ]).create(); | 21 ]).create(); |
| 22 |
| 23 pubGet(); |
| 22 }); | 24 }); |
| 23 | 25 |
| 24 integration("build --all finds assets in default source directories", () { | 26 integration("build --all finds assets in default source directories", () { |
| 25 schedulePub(args: ["build", "--all"], | 27 schedulePub(args: ["build", "--all"], |
| 26 output: new RegExp(r'Built 5 files to "build".')); | 28 output: new RegExp(r'Built 5 files to "build".')); |
| 27 | 29 |
| 28 d.dir(appPath, [ | 30 d.dir(appPath, [ |
| 29 d.dir('build', [ | 31 d.dir('build', [ |
| 30 d.dir('benchmark', [ | 32 d.dir('benchmark', [ |
| 31 d.file('file.txt', 'benchmark') | 33 d.file('file.txt', 'benchmark') |
| (...skipping 10 matching lines...) Expand all Loading... |
| 42 d.dir('web', [ | 44 d.dir('web', [ |
| 43 d.file('file.txt', 'web') | 45 d.file('file.txt', 'web') |
| 44 ]), | 46 ]), |
| 45 // Only includes default source directories. | 47 // Only includes default source directories. |
| 46 d.nothing('unknown') | 48 d.nothing('unknown') |
| 47 ]) | 49 ]) |
| 48 ]).validate(); | 50 ]).validate(); |
| 49 }); | 51 }); |
| 50 | 52 |
| 51 integration("serve --all finds assets in default source directories", () { | 53 integration("serve --all finds assets in default source directories", () { |
| 52 pubServe(args: ["--all"], shouldGetFirst: true); | 54 pubServe(args: ["--all"]); |
| 53 | 55 |
| 54 requestShouldSucceed("file.txt", "benchmark", root: "benchmark"); | 56 requestShouldSucceed("file.txt", "benchmark", root: "benchmark"); |
| 55 requestShouldSucceed("file.txt", "bin", root: "bin"); | 57 requestShouldSucceed("file.txt", "bin", root: "bin"); |
| 56 requestShouldSucceed("file.txt", "example", root: "example"); | 58 requestShouldSucceed("file.txt", "example", root: "example"); |
| 57 requestShouldSucceed("file.txt", "test", root: "test"); | 59 requestShouldSucceed("file.txt", "test", root: "test"); |
| 58 requestShouldSucceed("file.txt", "web", root: "web"); | 60 requestShouldSucceed("file.txt", "web", root: "web"); |
| 59 | 61 |
| 60 expectNotServed("unknown"); | 62 expectNotServed("unknown"); |
| 61 | 63 |
| 62 endPubServe(); | 64 endPubServe(); |
| 63 }); | 65 }); |
| 64 } | 66 } |
| OLD | NEW |