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

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

Issue 10628016: Add a Pub source for pub.dartlang.org. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 6 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
Index: utils/tests/pub/pub_test.dart
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
index 8b302d54885eb4f00dbc1c99d2a8ab315ac3c4da..4bfb2a331d5f62cc7f588690d466238c2d92a592 100644
--- a/utils/tests/pub/pub_test.dart
+++ b/utils/tests/pub/pub_test.dart
@@ -204,6 +204,112 @@ dependencies:
output: const RegExp("Dependencies installed!\$"));
});
});
+
+ test('checks out a package from a pub server', () {
+ servePackages("localhost", 3123, ['{name: foo, version: 1.2.3}']);
+
+ dir(appPath, [
+ file('pubspec.yaml', '''
+dependencies:
+ foo:
+ repo:
+ name: foo
+ url: http://localhost:3123
+ version: 1.2.3
+''')
+ ]).scheduleCreate();
+
+ dir(cachePath, [
+ dir('repo', [
+ dir('localhost%583123', [
+ dir('foo-1.2.3', [
+ file('pubspec.yaml', '{name: foo, version: 1.2.3}'),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ])
+ ])
+ ])
+ ]).scheduleValidate();
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('pubspec.yaml', '{name: foo, version: 1.2.3}'),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ])
+ ]).scheduleValidate();
+
+ runPub(args: ['install'],
+ output: const RegExp("Dependencies installed!\$"));
+ });
+
+ test('checks out packages transitively from a pub server', () {
+ servePackages("localhost", 3123, [
+ '''
+name: foo
+version: 1.2.3
+dependencies:
+ bar:
+ repo: {name: bar, url: http://localhost:3123}
+ version: 2.0.4
+''',
+ '{name: bar, version: 2.0.3}',
+ '{name: bar, version: 2.0.4}',
+ '{name: bar, version: 2.0.5}',
+ ]);
+
+ dir(appPath, [
+ file('pubspec.yaml', '''
+dependencies:
+ foo:
+ repo:
+ name: foo
+ url: http://localhost:3123
+ version: 1.2.3
+''')
+ ]).scheduleCreate();
+
+ dir(cachePath, [
+ dir('repo', [
+ dir('localhost%583123', [
+ dir('foo-1.2.3', [
+ file('pubspec.yaml', '''
+name: foo
+version: 1.2.3
+dependencies:
+ bar:
+ repo: {name: bar, url: http://localhost:3123}
+ version: 2.0.4
+'''),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ]),
+ dir('bar-2.0.4', [
+ file('pubspec.yaml', '{name: bar, version: 2.0.4}'),
+ file('bar.dart', 'main() => print("bar 2.0.4");')
+ ])
+ ])
+ ])
+ ]).scheduleValidate();
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('pubspec.yaml', '''
+name: foo
+version: 1.2.3
+dependencies:
+ bar:
+ repo: {name: bar, url: http://localhost:3123}
+ version: 2.0.4
+'''),
+ file('foo.dart', 'main() => print("foo 1.2.3");')
+ ]),
+ dir('bar', [
+ file('pubspec.yaml', '{name: bar, version: 2.0.4}'),
+ file('bar.dart', 'main() => print("bar 2.0.4");')
+ ])
+ ]).scheduleValidate();
+
+ runPub(args: ['install'],
+ output: const RegExp("Dependencies installed!\$"));
+ });
}
versionCommand() {
« utils/pub/io.dart ('K') | « utils/pub/utils.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698