| 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 '../test_pub.dart'; | 8 import '../test_pub.dart'; |
| 9 import '../serve/utils.dart'; | 9 import '../serve/utils.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('bar', [d.file('file.txt', 'bar')]), | 15 d.dir('bar', [d.file('file.txt', 'bar')]), |
| 16 d.dir('foo', [d.file('file.txt', 'foo')]), | 16 d.dir('foo', [d.file('file.txt', 'foo')]), |
| 17 d.dir('test', [d.file('file.txt', 'test')]), | 17 d.dir('test', [d.file('file.txt', 'test')]), |
| 18 d.dir('web', [d.file('file.txt', 'web')]) | 18 d.dir('web', [d.file('file.txt', 'web')]) |
| 19 ]).create(); | 19 ]).create(); |
| 20 |
| 21 pubGet(); |
| 20 }); | 22 }); |
| 21 | 23 |
| 22 integration("builds only the given directories", () { | 24 integration("builds only the given directories", () { |
| 23 schedulePub(args: ["build", "foo", "bar"], | 25 schedulePub(args: ["build", "foo", "bar"], |
| 24 output: new RegExp(r'Built 2 files to "build".')); | 26 output: new RegExp(r'Built 2 files to "build".')); |
| 25 | 27 |
| 26 d.dir(appPath, [ | 28 d.dir(appPath, [ |
| 27 d.dir('build', [ | 29 d.dir('build', [ |
| 28 d.dir('bar', [ | 30 d.dir('bar', [ |
| 29 d.file('file.txt', 'bar') | 31 d.file('file.txt', 'bar') |
| 30 ]), | 32 ]), |
| 31 d.dir('foo', [ | 33 d.dir('foo', [ |
| 32 d.file('file.txt', 'foo') | 34 d.file('file.txt', 'foo') |
| 33 ]), | 35 ]), |
| 34 d.nothing('test'), | 36 d.nothing('test'), |
| 35 d.nothing('web') | 37 d.nothing('web') |
| 36 ]) | 38 ]) |
| 37 ]).validate(); | 39 ]).validate(); |
| 38 }); | 40 }); |
| 39 | 41 |
| 40 integration("serves only the given directories", () { | 42 integration("serves only the given directories", () { |
| 41 pubServe(args: ["foo", "bar"], shouldGetFirst: true); | 43 pubServe(args: ["foo", "bar"]); |
| 42 | 44 |
| 43 requestShouldSucceed("file.txt", "bar", root: "bar"); | 45 requestShouldSucceed("file.txt", "bar", root: "bar"); |
| 44 requestShouldSucceed("file.txt", "foo", root: "foo"); | 46 requestShouldSucceed("file.txt", "foo", root: "foo"); |
| 45 expectNotServed("test"); | 47 expectNotServed("test"); |
| 46 expectNotServed("web"); | 48 expectNotServed("web"); |
| 47 | 49 |
| 48 endPubServe(); | 50 endPubServe(); |
| 49 }); | 51 }); |
| 50 } | 52 } |
| OLD | NEW |