OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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 library pub_tests; | 5 library pub_tests; |
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 initConfig(); | 12 initConfig(); |
13 withBarbackVersions("any", () { | 13 withBarbackVersions("any", () { |
14 integration("includes assets", () { | 14 integration("includes assets", () { |
15 d.dir(appPath, [ | 15 d.dir(appPath, [d.pubspec({ |
16 d.pubspec({ | |
17 "name": "myapp", | 16 "name": "myapp", |
18 "transformers": [ | 17 "transformers": [{ |
19 { | |
20 "myapp/src/transformer": { | 18 "myapp/src/transformer": { |
21 "\$include": [ | 19 "\$include": ["web/foo.txt", "web/sub/foo.txt"] |
22 "web/foo.txt", | |
23 "web/sub/foo.txt" | |
24 ] | |
25 } | 20 } |
26 } | 21 }] |
27 ] | |
28 }), | 22 }), |
29 d.dir("lib", [d.dir("src", [ | 23 d.dir("lib", [d.dir("src", [d.file("transformer.dart", REWRITE_TRANS
FORMER)])]), |
30 d.file("transformer.dart", REWRITE_TRANSFORMER) | 24 d.dir( |
31 ])]), | 25 "web", |
32 d.dir("web", [ | 26 [ |
33 d.file("foo.txt", "foo"), | 27 d.file("foo.txt", "foo"), |
34 d.file("bar.txt", "bar"), | 28 d.file("bar.txt", "bar"), |
35 d.dir("sub", [ | 29 d.dir("sub", [d.file("foo.txt", "foo"),])])]).create(); |
36 d.file("foo.txt", "foo"), | |
37 ]) | |
38 ]) | |
39 ]).create(); | |
40 | 30 |
41 createLockFile('myapp', pkg: ['barback']); | 31 createLockFile('myapp', pkg: ['barback']); |
42 | 32 |
43 pubServe(); | 33 pubServe(); |
44 requestShouldSucceed("foo.out", "foo.out"); | 34 requestShouldSucceed("foo.out", "foo.out"); |
45 requestShouldSucceed("sub/foo.out", "foo.out"); | 35 requestShouldSucceed("sub/foo.out", "foo.out"); |
46 requestShould404("bar.out"); | 36 requestShould404("bar.out"); |
47 endPubServe(); | 37 endPubServe(); |
48 }); | 38 }); |
49 }); | 39 }); |
50 } | 40 } |
OLD | NEW |