| 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 16 matching lines...) Expand all Loading... |
| 27 return transform.primaryInput.readAsString().then((contents) { | 27 return transform.primaryInput.readAsString().then((contents) { |
| 28 var id = transform.primaryInput.id.changeExtension(".json"); | 28 var id = transform.primaryInput.id.changeExtension(".json"); |
| 29 transform.addOutput( | 29 transform.addOutput( |
| 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 withBarbackVersions("any", () { | 37 integration("configuration defaults to an empty map", () { |
| 38 integration("configuration defaults to an empty map", () { | 38 d.dir(appPath, [ |
| 39 d.dir(appPath, [ | 39 d.pubspec({ |
| 40 d.pubspec({ | 40 "name": "myapp", |
| 41 "name": "myapp", | 41 "transformers": ["myapp/src/transformer"] |
| 42 "transformers": ["myapp/src/transformer"] | 42 }), |
| 43 }), | 43 d.dir("lib", [d.dir("src", [ |
| 44 d.dir("lib", [d.dir("src", [ | 44 d.file("transformer.dart", transformer) |
| 45 d.file("transformer.dart", transformer) | 45 ])]), |
| 46 ])]), | 46 d.dir("web", [ |
| 47 d.dir("web", [ | 47 d.file("foo.txt", "foo") |
| 48 d.file("foo.txt", "foo") | 48 ]) |
| 49 ]) | 49 ]).create(); |
| 50 ]).create(); | |
| 51 | 50 |
| 52 createLockFile('myapp', pkg: ['barback']); | 51 createLockFile('myapp', pkg: ['barback']); |
| 53 | 52 |
| 54 var server = pubServe(); | 53 var server = pubServe(); |
| 55 requestShouldSucceed("foo.json", JSON.encode({})); | 54 requestShouldSucceed("foo.json", JSON.encode({})); |
| 56 endPubServe(); | 55 endPubServe(); |
| 57 }); | 56 }); |
| 58 }); | |
| 59 } | 57 } |
| OLD | NEW |