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

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

Issue 10937018: Add tests for updating a git repo to a bad/different pubspec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_update_git_test.dart
diff --git a/utils/tests/pub/pub_update_git_test.dart b/utils/tests/pub/pub_update_git_test.dart
index 27b5b963c4c686d8fef8e64c20631f76e586cd06..fe622694331430c907d87295f25b5c6b0e81b953 100644
--- a/utils/tests/pub/pub_update_git_test.dart
+++ b/utils/tests/pub/pub_update_git_test.dart
@@ -62,6 +62,81 @@ main() {
run();
});
+ test("updates Git packages to an incompatible pubspec", () {
+ ensureGit();
+
+ git('foo.git', [
+ libDir('foo'),
+ libPubspec('foo', '1.0.0')
+ ]).scheduleCreate();
+
+ appDir([{"git": "../foo.git"}]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ])
+ ]).scheduleValidate();
+
+ git('foo.git', [
+ libDir('zoo'),
+ libPubspec('zoo', '1.0.0')
+ ]).scheduleCommit();
+
+ schedulePub(args: ['update'],
+ error: const RegExp(@'The name you specified for your dependency, '
+ @'"foo", doesn' @"'" @'t match the name "zoo" in its pubspec.'),
+ exitCode: 1);
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+
+ solo_test("updates Git packages to a nonexistent pubspec", () {
+ ensureGit();
+
+ var repo = git('foo.git', [
+ libDir('foo'),
+ libPubspec('foo', '1.0.0')
+ ]);
+ repo.scheduleCreate();
+
+ appDir([{"git": "../foo.git"}]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ])
+ ]).scheduleValidate();
+
+ repo.scheduleGit(['rm', 'pubspec.yaml']);
+ repo.scheduleGit(['commit', '-m', 'delete']);
+
+ schedulePub(args: ['update'],
+ error: const RegExp(@'Package "foo" doesn' @"'" @'t have a '
+ @'pubspec.yaml file.'),
+ exitCode: 1);
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+
group("with an argument", () {
test("updates one locked Git package but no others", () {
ensureGit();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698