| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, 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 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import '../../descriptor.dart' as d; | 9 import '../../descriptor.dart' as d; |
| 10 import '../../test_pub.dart'; | 10 import '../../test_pub.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 new Asset.fromString(id, JSON.encode(settings.configuration))); | 30 new Asset.fromString(id, JSON.encode(settings.configuration))); |
| 31 }); | 31 }); |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 """; | 34 """; |
| 35 | 35 |
| 36 main() { | 36 main() { |
| 37 initConfig(); | 37 initConfig(); |
| 38 withBarbackVersions("any", () { | 38 withBarbackVersions("any", () { |
| 39 integration("passes configuration to a transformer", () { | 39 integration("passes configuration to a transformer", () { |
| 40 var configuration = {"param": ["list", "of", "values"]}; | 40 var configuration = { |
| 41 "param": ["list", "of", "values"] |
| 42 }; |
| 41 | 43 |
| 42 d.dir(appPath, [ | 44 d.dir(appPath, [d.pubspec({ |
| 43 d.pubspec({ | |
| 44 "name": "myapp", | 45 "name": "myapp", |
| 45 "transformers": [{"myapp/src/transformer": configuration}] | 46 "transformers": [{ |
| 47 "myapp/src/transformer": configuration |
| 48 }] |
| 46 }), | 49 }), |
| 47 d.dir("lib", [d.dir("src", [ | 50 d.dir("lib", [d.dir("src", [d.file("transformer.dart", transformer)]
)]), |
| 48 d.file("transformer.dart", transformer) | 51 d.dir("web", [d.file("foo.txt", "foo")])]).create(); |
| 49 ])]), | |
| 50 d.dir("web", [ | |
| 51 d.file("foo.txt", "foo") | |
| 52 ]) | |
| 53 ]).create(); | |
| 54 | 52 |
| 55 createLockFile('myapp', pkg: ['barback']); | 53 createLockFile('myapp', pkg: ['barback']); |
| 56 | 54 |
| 57 var server = pubServe(); | 55 var server = pubServe(); |
| 58 requestShouldSucceed("foo.json", JSON.encode(configuration)); | 56 requestShouldSucceed("foo.json", JSON.encode(configuration)); |
| 59 endPubServe(); | 57 endPubServe(); |
| 60 }); | 58 }); |
| 61 }); | 59 }); |
| 62 } | 60 } |
| OLD | NEW |