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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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('test_pub.dart'); 9 #import('test_pub.dart');
10 #import('../../../pkg/unittest/unittest.dart'); 10 #import('../../../pkg/unittest/unittest.dart');
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 file('foo.dart', 'main() => "foo 2";') 55 file('foo.dart', 'main() => "foo 2";')
56 ]), 56 ]),
57 dir('bar', [ 57 dir('bar', [
58 file('bar.dart', 'main() => "bar 2";') 58 file('bar.dart', 'main() => "bar 2";')
59 ]) 59 ])
60 ]).scheduleValidate(); 60 ]).scheduleValidate();
61 61
62 run(); 62 run();
63 }); 63 });
64 64
65 test("updates Git packages to an incompatible pubspec", () {
66 ensureGit();
67
68 git('foo.git', [
69 libDir('foo'),
70 libPubspec('foo', '1.0.0')
71 ]).scheduleCreate();
72
73 appDir([{"git": "../foo.git"}]).scheduleCreate();
74
75 schedulePub(args: ['install'],
76 output: const RegExp(@"Dependencies installed!$"));
77
78 dir(packagesPath, [
79 dir('foo', [
80 file('foo.dart', 'main() => "foo";')
81 ])
82 ]).scheduleValidate();
83
84 git('foo.git', [
85 libDir('zoo'),
86 libPubspec('zoo', '1.0.0')
87 ]).scheduleCommit();
88
89 schedulePub(args: ['update'],
90 error: const RegExp(@'The name you specified for your dependency, '
91 @'"foo", doesn' @"'" @'t match the name "zoo" in its pubspec.'),
92 exitCode: 1);
93
94 dir(packagesPath, [
95 dir('foo', [
96 file('foo.dart', 'main() => "foo";')
97 ])
98 ]).scheduleValidate();
99
100 run();
101 });
102
103 solo_test("updates Git packages to a nonexistent pubspec", () {
104 ensureGit();
105
106 var repo = git('foo.git', [
107 libDir('foo'),
108 libPubspec('foo', '1.0.0')
109 ]);
110 repo.scheduleCreate();
111
112 appDir([{"git": "../foo.git"}]).scheduleCreate();
113
114 schedulePub(args: ['install'],
115 output: const RegExp(@"Dependencies installed!$"));
116
117 dir(packagesPath, [
118 dir('foo', [
119 file('foo.dart', 'main() => "foo";')
120 ])
121 ]).scheduleValidate();
122
123 repo.scheduleGit(['rm', 'pubspec.yaml']);
124 repo.scheduleGit(['commit', '-m', 'delete']);
125
126 schedulePub(args: ['update'],
127 error: const RegExp(@'Package "foo" doesn' @"'" @'t have a '
128 @'pubspec.yaml file.'),
129 exitCode: 1);
130
131 dir(packagesPath, [
132 dir('foo', [
133 file('foo.dart', 'main() => "foo";')
134 ])
135 ]).scheduleValidate();
136
137 run();
138 });
139
65 group("with an argument", () { 140 group("with an argument", () {
66 test("updates one locked Git package but no others", () { 141 test("updates one locked Git package but no others", () {
67 ensureGit(); 142 ensureGit();
68 143
69 git('foo.git', [ 144 git('foo.git', [
70 libDir('foo'), 145 libDir('foo'),
71 libPubspec('foo', '1.0.0') 146 libPubspec('foo', '1.0.0')
72 ]).scheduleCreate(); 147 ]).scheduleCreate();
73 148
74 git('bar.git', [ 149 git('bar.git', [
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 ]), 237 ]),
163 dir('foo-dep', [ 238 dir('foo-dep', [
164 file('foo-dep.dart', 'main() => "foo-dep";') 239 file('foo-dep.dart', 'main() => "foo-dep";')
165 ]), 240 ]),
166 ]).scheduleValidate(); 241 ]).scheduleValidate();
167 242
168 run(); 243 run();
169 }); 244 });
170 }); 245 });
171 } 246 }
OLDNEW
« 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