| 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 18 matching lines...) Expand all Loading... |
| 29 }).then((contents) { | 29 }).then((contents) { |
| 30 var id = new AssetId(transform.package, | 30 var id = new AssetId(transform.package, |
| 31 p.url.join(transform.key, 'out.txt')); | 31 p.url.join(transform.key, 'out.txt')); |
| 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(); | |
| 40 withBarbackVersions(">=0.14.1", () { | 39 withBarbackVersions(">=0.14.1", () { |
| 41 integration("loads an aggregate transformer", () { | 40 integration("loads an aggregate transformer", () { |
| 42 d.dir(appPath, [ | 41 d.dir(appPath, [ |
| 43 d.pubspec({ | 42 d.pubspec({ |
| 44 "name": "myapp", | 43 "name": "myapp", |
| 45 "transformers": ["myapp"] | 44 "transformers": ["myapp"] |
| 46 }), | 45 }), |
| 47 d.dir("lib", [ | 46 d.dir("lib", [ |
| 48 d.file("transformer.dart", AGGREGATE_TRANSFORMER), | 47 d.file("transformer.dart", AGGREGATE_TRANSFORMER), |
| 49 ]), | 48 ]), |
| 50 d.dir("web", [ | 49 d.dir("web", [ |
| 51 d.file("foo.txt", "foo"), | 50 d.file("foo.txt", "foo"), |
| 52 d.file("bar.txt", "bar") | 51 d.file("bar.txt", "bar") |
| 53 ]) | 52 ]) |
| 54 ]).create(); | 53 ]).create(); |
| 55 | 54 |
| 56 createLockFile('myapp', pkg: ['barback']); | 55 createLockFile('myapp', pkg: ['barback']); |
| 57 | 56 |
| 58 pubServe(); | 57 pubServe(); |
| 59 requestShouldSucceed("out.txt", "bar\nfoo"); | 58 requestShouldSucceed("out.txt", "bar\nfoo"); |
| 60 endPubServe(); | 59 endPubServe(); |
| 61 }); | 60 }); |
| 62 }); | 61 }); |
| 63 } | 62 } |
| OLD | NEW |