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

Unified Diff: utils/tests/pub/pub_test.dart

Issue 10809058: Make "pub update PACKAGE" update a specific package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« utils/pub/command_update.dart ('K') | « utils/pub/entrypoint.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_test.dart
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
index 168c9175dab557e14866f43102e24665915fab7a..1955e4f007ba98e2407ba3bd899bfc7c00b329f3 100644
--- a/utils/tests/pub/pub_test.dart
+++ b/utils/tests/pub/pub_test.dart
@@ -925,6 +925,170 @@ dependencies:
run();
});
+
+ group("with an argument", () {
+ test("updates one locked Git package but no others", () {
+ ensureGit();
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo";')
+ ]).scheduleCreate();
+
+ git('bar.git', [
+ file('bar.dart', 'main() => "bar";')
+ ]).scheduleCreate();
+
+ dir(appPath, [
+ file('pubspec.yaml', '''
+dependencies:
+ foo:
+ git: ../foo.git
+ bar:
+ git: ../foo.git
+''')
+ ]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ]),
+ dir('bar', [
+ file('bar.dart', 'main() => "bar";')
+ ])
+ ]).scheduleValidate();
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo 2";')
+ ]).scheduleCommit();
+
+ git('bar.git', [
+ file('bar.dart', 'main() => "bar 2";')
+ ]).scheduleCommit();
+
+ schedulePub(args: ['update foo'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo 2";')
+ ]),
+ dir('bar', [
+ file('bar.dart', 'main() => "bar";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+
+ test("updates one locked Git package's dependencies", () {
+ ensureGit();
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo";'),
+ file('pubspec.yaml', '''
+dependencies:
+ foo-dep:
+ git: ../foo-dep.git
+''')
+ ]).scheduleCreate();
+
+ git('foo-dep.git', [
+ file('foo-dep.dart', 'main() => "foo-dep";')
+ ]).scheduleCreate();
+
+ git('bar.git', [
+ file('bar.dart', 'main() => "bar";'),
+ file('pubspec.yaml', '''
+dependencies:
+ bar-dep:
+ git: ../bar-dep.git
+''')
+ ]).scheduleCreate();
+
+ git('bar-dep.git', [
+ file('bar-dep.dart', 'main() => "bar-dep";')
+ ]).scheduleCreate();
+
+ dir(appPath, [
+ file('pubspec.yaml', '''
+dependencies:
+ foo:
+ git: ../foo.git
+ bar:
+ git: ../foo.git
+''')
+ ]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";'),
+ file('pubspec.yaml', '''
+dependencies:
+ foo-dep:
+ git: ../foo-dep.git
+''')
+ ]),
+ dir('foo-dep', [
+ file('foo-dep.dart', 'main() => "foo-dep";')
+ ]),
+ dir('bar', [
+ file('bar.dart', 'main() => "bar";'),
+ file('pubspec.yaml', '''
+dependencies:
+ bar-dep:
+ git: ../bar-dep.git
+''')
+ ]),
+ dir('bar-dep', [
+ file('bar-dep.dart', 'main() => "bar-dep";')
+ ])
+ ]).scheduleValidate();
+
+ git('foo-dep.git', [
+ file('foo-dep.dart', 'main() => "foo-dep 2";')
+ ]).scheduleCommit();
+
+ git('bar-dep.git', [
+ file('bar-dep.dart', 'main() => "bar-dep 2";')
+ ]).scheduleCommit();
+
+ schedulePub(args: ['update foo'],
+ output: const RegExp(@"Dependencies updated!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";'),
+ file('pubspec.yaml', '''
+dependencies:
+ foo-dep:
+ git: ../foo-dep.git
+''')
+ ]),
+ dir('foo-dep', [
+ file('foo-dep.dart', 'main() => "foo-dep 2";')
+ ]),
+ dir('bar', [
+ file('bar.dart', 'main() => "bar";'),
+ file('pubspec.yaml', '''
+dependencies:
+ bar-dep:
+ git: ../bar-dep.git
+''')
+ ]),
+ dir('bar-dep', [
+ file('bar-dep.dart', 'main() => "bar-dep";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+ });
}
versionCommand() {
« utils/pub/command_update.dart ('K') | « utils/pub/entrypoint.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698