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_stream.dart'; | 7 import 'package:scheduled_test/scheduled_stream.dart'; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 Future<bool> isPrimary(_) => new Future.value(true); | 24 Future<bool> isPrimary(_) => new Future.value(true); |
25 Future apply(Transform transform) {} | 25 Future apply(Transform transform) {} |
26 } | 26 } |
27 """; | 27 """; |
28 | 28 |
29 main() { | 29 main() { |
30 integration("multiple transformers in the same phase reject their " | 30 integration("multiple transformers in the same phase reject their " |
31 "configurations", () { | 31 "configurations", () { |
| 32 serveBarback(); |
| 33 |
32 d.dir(appPath, [ | 34 d.dir(appPath, [ |
33 d.pubspec({ | 35 d.pubspec({ |
34 "name": "myapp", | 36 "name": "myapp", |
35 "transformers": [[ | 37 "transformers": [[ |
36 {"myapp/src/transformer": {'foo': 'bar'}}, | 38 {"myapp/src/transformer": {'foo': 'bar'}}, |
37 {"myapp/src/transformer": {'baz': 'bang'}}, | 39 {"myapp/src/transformer": {'baz': 'bang'}}, |
38 {"myapp/src/transformer": {'qux': 'fblthp'}} | 40 {"myapp/src/transformer": {'qux': 'fblthp'}} |
39 ]] | 41 ]], |
| 42 "dependencies": {"barback": "any"} |
40 }), | 43 }), |
41 d.dir("lib", [d.dir("src", [ | 44 d.dir("lib", [d.dir("src", [ |
42 d.file("transformer.dart", REJECT_CONFIG_TRANSFORMER) | 45 d.file("transformer.dart", REJECT_CONFIG_TRANSFORMER) |
43 ])]) | 46 ])]) |
44 ]).create(); | 47 ]).create(); |
45 | 48 |
46 createLockFile('myapp', pkg: ['barback']); | 49 pubGet(); |
47 | |
48 // We should see three instances of the error message, once for each | 50 // We should see three instances of the error message, once for each |
49 // use of the transformer. | 51 // use of the transformer. |
50 var pub = startPubServe(); | 52 var pub = startPubServe(); |
51 for (var i = 0; i < 3; i++) { | 53 for (var i = 0; i < 3; i++) { |
52 pub.stderr.expect(consumeThrough(endsWith('Error loading transformer: ' | 54 pub.stderr.expect(consumeThrough(endsWith('Error loading transformer: ' |
53 'I hate these settings!'))); | 55 'I hate these settings!'))); |
54 } | 56 } |
55 pub.shouldExit(1); | 57 pub.shouldExit(1); |
56 }); | 58 }); |
57 } | 59 } |
OLD | NEW |