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