OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS 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:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
11 import 'descriptor.dart' as d; | 11 import 'descriptor.dart' as d; |
12 import 'test_pub.dart'; | 12 import 'test_pub.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 initConfig(); | 15 initConfig(); |
16 | 16 |
17 forBothPubInstallAndUpdate((command) { | 17 forBothPubInstallAndUpdate((command) { |
18 group('requires', () { | 18 group('requires', () { |
19 integration('a pubspec', () { | 19 integration('a pubspec', () { |
20 d.dir(appPath, []).create(); | 20 d.dir(appPath, []).create(); |
21 | 21 |
22 pubCommand(command, | 22 pubCommand(command, |
23 error: new RegExp(r'^Could not find a file named "pubspec.yaml"')); | 23 error: new RegExp(r'^Could not find a file named "pubspec.yaml" ' |
| 24 r'in the directory .*\.$')); |
24 }); | 25 }); |
25 | 26 |
26 integration('a pubspec with a "name" key', () { | 27 integration('a pubspec with a "name" key', () { |
27 d.dir(appPath, [ | 28 d.dir(appPath, [ |
28 d.pubspec({"dependencies": {"foo": null}}) | 29 d.pubspec({"dependencies": {"foo": null}}) |
29 ]).create(); | 30 ]).create(); |
30 | 31 |
31 pubCommand(command, error: new RegExp( | 32 pubCommand(command, error: |
32 r'^pubspec.yaml is missing the required "name" field ' | 33 'pubspec.yaml is missing the required "name" field ' |
33 r'\(e\.g\. "name: myapp"\)\.')); | 34 '(e.g. "name: myapp").'); |
34 }); | 35 }); |
35 }); | 36 }); |
36 | 37 |
37 integration('adds itself to the packages', () { | 38 integration('adds itself to the packages', () { |
38 // The symlink should use the name in the pubspec, not the name of the | 39 // The symlink should use the name in the pubspec, not the name of the |
39 // directory. | 40 // directory. |
40 d.dir(appPath, [ | 41 d.dir(appPath, [ |
41 d.pubspec({"name": "myapp_name"}), | 42 d.pubspec({"name": "myapp_name"}), |
42 d.libDir('myapp_name') | 43 d.libDir('myapp_name') |
43 ]).create(); | 44 ]).create(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ]).create(); | 106 ]).create(); |
106 | 107 |
107 d.dir(appPath, [ | 108 d.dir(appPath, [ |
108 d.pubspec({"name": "myapp", "dependencies": { | 109 d.pubspec({"name": "myapp", "dependencies": { |
109 "foo": {"path": "../deps/foo"}, | 110 "foo": {"path": "../deps/foo"}, |
110 "bar": {"path": "../deps/bar"} | 111 "bar": {"path": "../deps/bar"} |
111 }}) | 112 }}) |
112 ]).create(); | 113 ]).create(); |
113 | 114 |
114 pubCommand(command, | 115 pubCommand(command, |
115 error: new RegExp(r"^Incompatible dependencies on 'baz':")); | 116 error: new RegExp("^Incompatible dependencies on 'baz':\n")); |
116 }); | 117 }); |
117 }); | 118 }); |
118 } | 119 } |
OLD | NEW |