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 15 matching lines...) Expand all Loading... |
26 var id = transform.primaryInput.id.changeExtension(".out"); | 26 var id = transform.primaryInput.id.changeExtension(".out"); |
27 var asset = new Asset.fromString(id, | 27 var asset = new Asset.fromString(id, |
28 "primary: \${results[0]}, secondary: \${results[1]}"); | 28 "primary: \${results[0]}, secondary: \${results[1]}"); |
29 transform.addOutput(asset); | 29 transform.addOutput(asset); |
30 }); | 30 }); |
31 } | 31 } |
32 } | 32 } |
33 """; | 33 """; |
34 | 34 |
35 main() { | 35 main() { |
36 initConfig(); | |
37 withBarbackVersions("any", () { | 36 withBarbackVersions("any", () { |
38 integration("a transform can use hasInput", () { | 37 integration("a transform can use hasInput", () { |
39 d.dir(appPath, [ | 38 d.dir(appPath, [ |
40 d.pubspec({ | 39 d.pubspec({ |
41 "name": "myapp", | 40 "name": "myapp", |
42 "transformers": ["myapp/src/transformer"] | 41 "transformers": ["myapp/src/transformer"] |
43 }), | 42 }), |
44 d.dir("lib", [d.dir("src", [ | 43 d.dir("lib", [d.dir("src", [ |
45 d.file("transformer.dart", TRANSFORMER) | 44 d.file("transformer.dart", TRANSFORMER) |
46 ])]), | 45 ])]), |
47 d.dir("web", [ | 46 d.dir("web", [ |
48 d.file("foo.txt", "foo") | 47 d.file("foo.txt", "foo") |
49 ]) | 48 ]) |
50 ]).create(); | 49 ]).create(); |
51 | 50 |
52 createLockFile('myapp', pkg: ['barback']); | 51 createLockFile('myapp', pkg: ['barback']); |
53 | 52 |
54 pubServe(); | 53 pubServe(); |
55 requestShouldSucceed("foo.out", "primary: true, secondary: false"); | 54 requestShouldSucceed("foo.out", "primary: true, secondary: false"); |
56 endPubServe(); | 55 endPubServe(); |
57 }); | 56 }); |
58 }); | 57 }); |
59 } | 58 } |
OLD | NEW |