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

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

Issue 10875056: Properly handle Git URLs with trailing slashes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « utils/pub/pubspec.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_install_git_test.dart
diff --git a/utils/tests/pub/pub_install_git_test.dart b/utils/tests/pub/pub_install_git_test.dart
index 3661f1f95aa9b58810dbacd5251222c7deb12167..1c98af149b38b245d4717c5ef9da4306254642bc 100644
--- a/utils/tests/pub/pub_install_git_test.dart
+++ b/utils/tests/pub/pub_install_git_test.dart
@@ -78,6 +78,32 @@ main() {
run();
});
+ test('requires the repository name to match the name in the pubspec', () {
+ ensureGit();
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo";')
+ ]).scheduleCreate();
+
+ dir(appPath, [
+ pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "weird-name": {"git": "../foo.git"}
+ }
+ })
+ ]).scheduleCreate();
+
+ // TODO(nweiz): clean up this RegExp when either issue 4706 or 4707 is
+ // fixed.
+ schedulePub(args: ['install'],
+ error: const RegExp(@'^FormatException: The name you specified for '
+ @'your dependency, "weird-name", doesn' @"'" @'t match the name '
+ @'"foo" \(from "\.\./foo\.git"\)\.'));
+
+ run();
+ });
+
test('checks out and updates a package from Git', () {
ensureGit();
@@ -310,4 +336,34 @@ main() {
run();
});
+
+ group("(regression)", () {
Bob Nystrom 2012/08/24 21:03:16 I don't think this group() adds much. Every test i
nweiz 2012/08/24 21:09:20 I think there's a useful distinction between tests
+ test('checks out a package from Git with a trailing slash', () {
+ ensureGit();
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo";')
+ ]).scheduleCreate();
+
+ appDir([{"git": "../foo.git/"}]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(cachePath, [
+ dir('git', [
+ dir('cache', [gitPackageCacheDir('foo')]),
+ gitPackageCacheDir('foo')
+ ])
+ ]).scheduleValidate();
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+ });
}
« no previous file with comments | « utils/pub/pubspec.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698