| 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; |
| 11 import '../test_pub.dart'; | 11 import '../test_pub.dart'; |
| 12 import '../serve/utils.dart'; | 12 import '../serve/utils.dart'; |
| 13 | 13 |
| 14 const REJECT_CONFIG_TRANSFORMER = """ | 14 const REJECT_CONFIG_TRANSFORMER = """ |
| 15 import 'dart:async'; | 15 import 'dart:async'; |
| 16 | 16 |
| 17 import 'package:barback/barback.dart'; | 17 import 'package:barback/barback.dart'; |
| 18 | 18 |
| 19 class RejectConfigTransformer extends Transformer { | 19 class RejectConfigTransformer extends Transformer { |
| 20 RejectConfigTransformer.asPlugin(BarbackSettings settings) { | 20 RejectConfigTransformer.asPlugin(BarbackSettings settings) { |
| 21 throw "I hate these settings!"; | 21 throw "I hate these settings!"; |
| 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 initConfig(); | |
| 31 | |
| 32 withBarbackVersions("any", () { | 30 withBarbackVersions("any", () { |
| 33 integration("multiple transformers in the same phase reject their " | 31 integration("multiple transformers in the same phase reject their " |
| 34 "configurations", () { | 32 "configurations", () { |
| 35 d.dir(appPath, [ | 33 d.dir(appPath, [ |
| 36 d.pubspec({ | 34 d.pubspec({ |
| 37 "name": "myapp", | 35 "name": "myapp", |
| 38 "transformers": [[ | 36 "transformers": [[ |
| 39 {"myapp/src/transformer": {'foo': 'bar'}}, | 37 {"myapp/src/transformer": {'foo': 'bar'}}, |
| 40 {"myapp/src/transformer": {'baz': 'bang'}}, | 38 {"myapp/src/transformer": {'baz': 'bang'}}, |
| 41 {"myapp/src/transformer": {'qux': 'fblthp'}} | 39 {"myapp/src/transformer": {'qux': 'fblthp'}} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 // use of the transformer. | 50 // use of the transformer. |
| 53 var pub = startPubServe(); | 51 var pub = startPubServe(); |
| 54 for (var i = 0; i < 3; i++) { | 52 for (var i = 0; i < 3; i++) { |
| 55 pub.stderr.expect(consumeThrough(endsWith('Error loading transformer: ' | 53 pub.stderr.expect(consumeThrough(endsWith('Error loading transformer: ' |
| 56 'I hate these settings!'))); | 54 'I hate these settings!'))); |
| 57 } | 55 } |
| 58 pub.shouldExit(1); | 56 pub.shouldExit(1); |
| 59 }); | 57 }); |
| 60 }); | 58 }); |
| 61 } | 59 } |
| OLD | NEW |