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 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 Future<bool> isPrimary(_) => new Future.value(true); | 23 Future<bool> isPrimary(_) => new Future.value(true); |
24 Future apply(Transform transform) {} | 24 Future apply(Transform transform) {} |
25 } | 25 } |
26 """; | 26 """; |
27 | 27 |
28 main() { | 28 main() { |
29 initConfig(); | 29 initConfig(); |
30 | 30 |
31 withBarbackVersions("any", () { | 31 withBarbackVersions("any", () { |
32 integration("a transformer can reject is configuration", () { | 32 integration("a transformer can reject is configuration", () { |
33 d.dir(appPath, [ | 33 d.dir(appPath, [d.pubspec({ |
34 d.pubspec({ | 34 "name": "myapp", |
35 "name": "myapp", | 35 "transformers": [{ |
36 "transformers": [{"myapp/src/transformer": {'foo': 'bar'}}] | 36 "myapp/src/transformer": { |
37 }), | 37 'foo': 'bar' |
38 d.dir("lib", [d.dir("src", [ | 38 } |
39 d.file("transformer.dart", REJECT_CONFIG_TRANSFORMER) | 39 }] |
40 ])]) | 40 }), |
41 ]).create(); | 41 d.dir( |
| 42 "lib", |
| 43 [ |
| 44 d.dir( |
| 45 "src", |
| 46 [d.file("transformer.dart", REJECT_CONFIG_TRANSFORMER)])
])]).create(); |
42 | 47 |
43 createLockFile('myapp', pkg: ['barback']); | 48 createLockFile('myapp', pkg: ['barback']); |
44 | 49 |
45 var pub = startPubServe(); | 50 var pub = startPubServe(); |
46 pub.stderr.expect(endsWith('Error loading transformer: I hate these ' | 51 pub.stderr.expect( |
47 'settings!')); | 52 endsWith('Error loading transformer: I hate these ' 'settings!')); |
48 pub.shouldExit(1); | 53 pub.shouldExit(1); |
49 }); | 54 }); |
50 }); | 55 }); |
51 } | 56 } |
OLD | NEW |