| 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 '../../../../pkg/unittest/lib/unittest.dart'; | 9 import '../../../../pkg/unittest/lib/unittest.dart'; |
| 10 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 initConfig(); |
| 13 group('requires', () { | 14 group('requires', () { |
| 14 integration('a pubspec', () { | 15 integration('a pubspec', () { |
| 15 dir(appPath, []).scheduleCreate(); | 16 dir(appPath, []).scheduleCreate(); |
| 16 | 17 |
| 17 schedulePub(args: ['update'], | 18 schedulePub(args: ['update'], |
| 18 error: new RegExp(r'^Could not find a file named "pubspec.yaml"'), | 19 error: new RegExp(r'^Could not find a file named "pubspec.yaml"'), |
| 19 exitCode: 1); | 20 exitCode: 1); |
| 20 }); | 21 }); |
| 21 | 22 |
| 22 integration('a pubspec with a "name" key', () { | 23 integration('a pubspec with a "name" key', () { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 schedulePub(args: ['update'], | 61 schedulePub(args: ['update'], |
| 61 output: new RegExp(r"Dependencies updated!$")); | 62 output: new RegExp(r"Dependencies updated!$")); |
| 62 | 63 |
| 63 dir(packagesPath, [ | 64 dir(packagesPath, [ |
| 64 nothing("myapp_name") | 65 nothing("myapp_name") |
| 65 ]).scheduleValidate(); | 66 ]).scheduleValidate(); |
| 66 }); | 67 }); |
| 67 | 68 |
| 68 integration('does not add a package if it does not have a "lib" ' | 69 integration('does not add a package if it does not have a "lib" ' |
| 69 'directory', () { | 70 'directory', () { |
| 70 // Using an SDK source, but this should be true of all sources. | 71 // Using a path source, but this should be true of all sources. |
| 71 dir(sdkPath, [ | 72 dir('foo', [ |
| 72 dir('pkg', [ | 73 libPubspec('foo', '0.0.0-not.used') |
| 73 dir('foo', [ | |
| 74 libPubspec('foo', '0.0.0-not.used') | |
| 75 ]) | |
| 76 ]) | |
| 77 ]).scheduleCreate(); | 74 ]).scheduleCreate(); |
| 78 | 75 |
| 79 dir(appPath, [ | 76 dir(appPath, [ |
| 80 pubspec({"name": "myapp", "dependencies": {"foo": {"sdk": "foo"}}}) | 77 pubspec({"name": "myapp", "dependencies": {"foo": {"path": "../foo"}}}) |
| 81 ]).scheduleCreate(); | 78 ]).scheduleCreate(); |
| 82 | 79 |
| 83 schedulePub(args: ['update'], | 80 schedulePub(args: ['update'], |
| 84 output: new RegExp(r"Dependencies updated!$")); | 81 output: new RegExp(r"Dependencies updated!$")); |
| 85 | 82 |
| 86 packagesDir({"foo": null}).scheduleValidate(); | 83 packagesDir({"foo": null}).scheduleValidate(); |
| 87 }); | 84 }); |
| 88 } | 85 } |
| OLD | NEW |