Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: sdk/lib/_internal/pub_generated/test/transformer/a_transformer_rejects_its_config_test.dart

Issue 896623005: Use native async/await support in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library pub_tests;
6
7 import 'package:scheduled_test/scheduled_test.dart';
8
9 import '../descriptor.dart' as d;
10 import '../test_pub.dart';
11 import '../serve/utils.dart';
12
13 const REJECT_CONFIG_TRANSFORMER = """
14 import 'dart:async';
15
16 import 'package:barback/barback.dart';
17
18 class RejectConfigTransformer extends Transformer {
19 RejectConfigTransformer.asPlugin(BarbackSettings settings) {
20 throw "I hate these settings!";
21 }
22
23 Future<bool> isPrimary(_) => new Future.value(true);
24 Future apply(Transform transform) {}
25 }
26 """;
27
28 main() {
29 initConfig();
30
31 withBarbackVersions("any", () {
32 integration("a transformer can reject is configuration", () {
33 d.dir(appPath, [d.pubspec({
34 "name": "myapp",
35 "transformers": [{
36 "myapp/src/transformer": {
37 'foo': 'bar'
38 }
39 }]
40 }),
41 d.dir(
42 "lib",
43 [
44 d.dir(
45 "src",
46 [d.file("transformer.dart", REJECT_CONFIG_TRANSFORMER)]) ])]).create();
47
48 createLockFile('myapp', pkg: ['barback']);
49
50 var pub = startPubServe();
51 pub.stderr.expect(
52 endsWith('Error loading transformer: I hate these ' 'settings!'));
53 pub.shouldExit(1);
54 });
55 });
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698