| Index: utils/tests/pub/pub_test.dart
|
| diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
|
| index 34046bd345a451d99f83d00df2264ceb7c3a64ac..66f1fe83a3c5a3908fedfa42039ce271d8df0f7b 100644
|
| --- a/utils/tests/pub/pub_test.dart
|
| +++ b/utils/tests/pub/pub_test.dart
|
| @@ -90,6 +90,45 @@ listCommand() {
|
| }
|
|
|
| installCommand() {
|
| + group('requires', () {
|
| + test('a pubspec', () {
|
| + dir(appPath, []).scheduleCreate();
|
| +
|
| + schedulePub(args: ['install'],
|
| + error: const RegExp(@'^"pubspec.yaml" not found\.'));
|
| +
|
| + run();
|
| + });
|
| +
|
| + test('a pubspec with a "name" key', () {
|
| + dir(appPath, [
|
| + pubspec({"dependencies": {"foo": null}})
|
| + ]).scheduleCreate();
|
| +
|
| + schedulePub(args: ['install'],
|
| + error: const RegExp(@'^"pubspec.yaml" must contain a "name" key\.'));
|
| +
|
| + run();
|
| + });
|
| + });
|
| +
|
| + test('creates a self-referential symlink', () {
|
| + // The symlink should use the name in the pubspec, not the name of the
|
| + // directory.
|
| + dir(appPath, [
|
| + pubspec({"name": "myapp_name"})
|
| + ]).scheduleCreate();
|
| +
|
| + schedulePub(args: ['install'],
|
| + output: const RegExp(@"Dependencies installed!$"));
|
| +
|
| + dir(packagesPath, [
|
| + dir("myapp_name", [pubspec({"name": "myapp_name"})])
|
| + ]).scheduleValidate();
|
| +
|
| + run();
|
| + });
|
| +
|
| test('checks out a package from the SDK', () {
|
| dir(sdkPath, [
|
| file('revision', '1234'),
|
| @@ -97,7 +136,7 @@ installCommand() {
|
| ]).scheduleCreate();
|
|
|
| dir(appPath, [
|
| - pubspec({"dependencies": {"foo": null}})
|
| + pubspec({"name": "myapp", "dependencies": {"foo": null}})
|
| ]).scheduleCreate();
|
|
|
| schedulePub(args: ['install'],
|
| @@ -633,6 +672,28 @@ installCommand() {
|
| }
|
|
|
| updateCommand() {
|
| + group('requires', () {
|
| + test('a pubspec', () {
|
| + dir(appPath, []).scheduleCreate();
|
| +
|
| + schedulePub(args: ['update'],
|
| + error: const RegExp(@'^"pubspec.yaml" not found\.'));
|
| +
|
| + run();
|
| + });
|
| +
|
| + test('a pubspec with a "name" key', () {
|
| + dir(appPath, [
|
| + pubspec({"dependencies": {"foo": null}})
|
| + ]).scheduleCreate();
|
| +
|
| + schedulePub(args: ['update'],
|
| + error: const RegExp(@'^"pubspec.yaml" must contain a "name" key\.'));
|
| +
|
| + run();
|
| + });
|
| + });
|
| +
|
| test("updates locked Git packages", () {
|
| ensureGit();
|
|
|
|
|