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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 transform.addOutput(new Asset.fromString(id, contents.join('\\n'))); | 32 transform.addOutput(new Asset.fromString(id, contents.join('\\n'))); |
33 }); | 33 }); |
34 } | 34 } |
35 } | 35 } |
36 """; | 36 """; |
37 | 37 |
38 main() { | 38 main() { |
39 initConfig(); | 39 initConfig(); |
40 withBarbackVersions(">=0.14.1", () { | 40 withBarbackVersions(">=0.14.1", () { |
41 integration("works on an aggregate transformer", () { | 41 integration("works on an aggregate transformer", () { |
42 d.dir(appPath, [ | 42 d.dir(appPath, [d.pubspec({ |
43 d.pubspec({ | |
44 "name": "myapp", | 43 "name": "myapp", |
45 "transformers": [ | 44 "transformers": [{ |
46 { | |
47 "myapp": { | 45 "myapp": { |
48 "\$include": ["web/a.txt", "web/b.txt", "web/c.txt"], | 46 "\$include": ["web/a.txt", "web/b.txt", "web/c.txt"], |
49 "\$exclude": "web/a.txt" | 47 "\$exclude": "web/a.txt" |
50 } | 48 } |
51 } | 49 }] |
52 ] | |
53 }), | 50 }), |
54 d.dir("lib", [ | 51 d.dir("lib", [d.file("transformer.dart", AGGREGATE_TRANSFORMER),]), |
55 d.file("transformer.dart", AGGREGATE_TRANSFORMER), | 52 d.dir( |
56 ]), | 53 "web", |
57 d.dir("web", [ | 54 [ |
58 d.file("a.txt", "a"), | 55 d.file("a.txt", "a"), |
59 d.file("b.txt", "b"), | 56 d.file("b.txt", "b"), |
60 d.file("c.txt", "c"), | 57 d.file("c.txt", "c"), |
61 d.file("d.txt", "d") | 58 d.file("d.txt", "d")])]).create(); |
62 ]) | |
63 ]).create(); | |
64 | 59 |
65 createLockFile('myapp', pkg: ['barback']); | 60 createLockFile('myapp', pkg: ['barback']); |
66 | 61 |
67 pubServe(); | 62 pubServe(); |
68 requestShouldSucceed("out.txt", "b\nc"); | 63 requestShouldSucceed("out.txt", "b\nc"); |
69 endPubServe(); | 64 endPubServe(); |
70 }); | 65 }); |
71 }); | 66 }); |
72 } | 67 } |
OLD | NEW |