Chromium Code Reviews| Index: utils/tests/pub/pub_test.dart |
| diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart |
| index f69969eaad0d67e37b5bceb1938b261412498d3f..ca23787f2c650f0a5511d31338520058bcd473d0 100644 |
| --- a/utils/tests/pub/pub_test.dart |
| +++ b/utils/tests/pub/pub_test.dart |
| @@ -92,7 +92,7 @@ installCommand() { |
| ]).scheduleCreate(); |
| dir(appPath, [ |
| - file('pubspec', 'dependencies:\n- foo') |
| + file('pubspec', 'dependencies:\n foo:') |
| ]).scheduleCreate(); |
| dir(packagesPath, [ |
| @@ -112,7 +112,7 @@ installCommand() { |
| dir('lib', [ |
| dir('foo', [ |
| file('foo.dart', 'main() => "foo";'), |
| - file('pubspec', 'dependencies:\n- bar') |
| + file('pubspec', 'dependencies:\n bar:') |
| ]), |
| dir('bar', [ |
| file('bar.dart', 'main() => "bar";'), |
| @@ -121,7 +121,7 @@ installCommand() { |
| ]).scheduleCreate(); |
| dir(appPath, [ |
| - file('pubspec', 'dependencies:\n- foo') |
| + file('pubspec', 'dependencies:\n foo:') |
| ]).scheduleCreate(); |
| dir(packagesPath, [ |
| @@ -138,6 +138,60 @@ installCommand() { |
| Dependencies installed! |
| '''); |
| }); |
| + |
| + String _gitPubspec(String name) => ''' |
|
Bob Nystrom
2012/05/14 19:40:02
As much as I like DRY, I think the tests would be
nweiz
2012/05/14 19:53:38
Done.
|
| +dependencies: |
| + $name: |
| + git: ../$name.git |
| +'''; |
| + |
| + test('checks out a package from Git', () { |
| + git('foo.git', [ |
| + file('foo.dart', 'main() => "foo";') |
| + ]).scheduleCreate(); |
| + |
| + dir(appPath, [ |
| + file('pubspec', _gitPubspec('foo')) |
| + ]).scheduleCreate(); |
| + |
| + dir(packagesPath, [ |
| + dir('foo', [ |
| + file('foo.dart', 'main() => "foo";') |
| + ]) |
| + ]).scheduleValidate(); |
| + |
| + runPub(args: ['install'], |
| + output: const RegExp("^Cloning into[\\s\\S]*^Dependencies installed!\$", |
|
Bob Nystrom
2012/05/14 19:40:02
You can use a raw string instead of escaping \:
@
nweiz
2012/05/14 19:53:38
Done.
|
| + multiLine: true)); |
| + }); |
| + |
| + test('checks out packages transitively from Git', () { |
| + git('foo.git', [ |
| + file('foo.dart', 'main() => "foo";'), |
| + file('pubspec', _gitPubspec('bar')) |
| + ]).scheduleCreate(); |
| + |
| + git('bar.git', [ |
| + file('bar.dart', 'main() => "bar";') |
| + ]).scheduleCreate(); |
| + |
| + dir(appPath, [ |
| + file('pubspec', _gitPubspec('foo')) |
| + ]).scheduleCreate(); |
| + |
| + dir(packagesPath, [ |
| + dir('foo', [ |
| + file('foo.dart', 'main() => "foo";') |
| + ]), |
| + dir('bar', [ |
| + file('bar.dart', 'main() => "bar";') |
| + ]) |
| + ]).scheduleValidate(); |
| + |
| + runPub(args: ['install'], |
| + output: const RegExp("^Cloning into[\\s\\S]*^Dependencies installed!\$", |
| + multiLine: true)); |
| + }); |
| } |
| versionCommand() { |