Chromium Code Reviews| 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(); |
| + }); |
| + }); |
| } |