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

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

Issue 12755024: add cache list command to pub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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_cache_test.dart
===================================================================
--- utils/tests/pub/pub_cache_test.dart (revision 0)
+++ utils/tests/pub/pub_cache_test.dart (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub_cache_test;
+
+import 'dart:io';
+import 'dart:json' as json;
+import 'test_pub.dart';
+import '../../pub/io.dart';
+
+
+main() {
+ initConfig();
+
+ integration('running pub cache list', () {
+
Bob Nystrom 2013/03/12 22:12:03 Remove this empty line.
keertip 2013/03/13 15:55:00 Done.
+ servePackages([package("foo", "1.2.3")]);
Bob Nystrom 2013/03/12 22:12:03 Since you're actually creating the cache, you can
keertip 2013/03/13 15:55:00 Done.
keertip 2013/03/13 15:55:00 Done.
+
+ // Set up a cache.
+ dir(cachePath, [
+ dir('hosted', [
+ async(port.then((p) => dir('pub.dartlang.org', [
Bob Nystrom 2013/03/12 22:12:03 ...and async(port.then((p) => (since you don't us
keertip 2013/03/13 15:55:00 Done.
+ dir("foo-1.2.3", [
+ libPubspec("foo", "1.2.3"),
+ libDir("foo")
+ ])
Bob Nystrom 2013/03/12 22:12:03 Let's add another package here too to make sure it
keertip 2013/03/13 15:55:00 Done.
+ ])))
+ ])
+ ]).scheduleCreate();
+
+
+ appDir([dependency("foo", "1.2.3")]).scheduleCreate();
Bob Nystrom 2013/03/12 22:12:03 ...and this...
keertip 2013/03/13 15:55:00 Done.
keertip 2013/03/13 15:55:00 Done.
+
+ schedulePub(args: ['install'],
+ output: new RegExp("Dependencies installed!\$"));
Bob Nystrom 2013/03/12 22:12:03 ..and this...
keertip 2013/03/13 15:55:00 Done.
+
+ cacheDir({"foo": "1.2.3"}).scheduleValidate();
Bob Nystrom 2013/03/12 22:12:03 ..and this...
Bob Nystrom 2013/03/12 22:12:03 ...and this...
keertip 2013/03/13 15:55:00 Done.
keertip 2013/03/13 15:55:00 Done.
keertip 2013/03/13 15:55:00 Done.
+
+ schedulePub(args: ['cache', 'list'], output:
+ new RegExp(r'{"pubcache":{"foo":{"version":"1.2.3","location":"[^"]+foo-1.2.3"}}}$'));
Bob Nystrom 2013/03/12 22:12:03 Instead of a RegExp, it's probably simpler here to
nweiz 2013/03/12 22:58:48 I think a RegExp is right... the location can vary
keertip 2013/03/13 15:55:00 Done.
+ });
+
Bob Nystrom 2013/03/12 22:12:03 Add tests that: 1. It exits with the right error
keertip 2013/03/13 15:55:00 Done.
+}
+

Powered by Google App Engine
This is Rietveld 408576698