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

Unified Diff: utils/tests/pub/update/pub_update_test.dart

Issue 14241005: Use the cached pubspec if possible for describing hosted packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« utils/tests/pub/test_pub.dart ('K') | « utils/tests/pub/test_pub.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/update/pub_update_test.dart
diff --git a/utils/tests/pub/update/pub_update_test.dart b/utils/tests/pub/update/pub_update_test.dart
index 8242d887cf39cd795b1b3b4ebd87099f0e8e0d8e..8f4d7b5ae795a9a225845303908e8cdf73d3a3e8 100644
--- a/utils/tests/pub/update/pub_update_test.dart
+++ b/utils/tests/pub/update/pub_update_test.dart
@@ -84,4 +84,33 @@ main() {
d.packagesDir({"foo": null}).validate();
});
+
+ integration('does not request a pubspec for a cached package', () {
+ servePackages([packageMap("foo", "1.2.3")]);
+
+ d.appDir([dependencyMap("foo", "1.2.3")]).create();
+
+ // Run install once so it gets cached.
+ schedulePub(args: ['install'],
+ output: new RegExp("Dependencies installed!\$"));
+
+ schedule(() {
+ // Clear the cache. We don't care about anything that was served during
+ // the initial install.
+ getRequestedPaths();
+ });
+
+ d.cacheDir({"foo": "1.2.3"}).validate();
+ d.packagesDir({"foo": "1.2.3"}).validate();
+
+ schedulePub(args: ['update'],
+ output: new RegExp("Dependencies updated!\$"));
+
+ schedule(() {
+ // The update should not have requested the pubspec since it's installed
+ // locally already.
+ expect(getRequestedPaths(),
+ isNot(contains("packages/foo/versions/1.2.3.yaml")));
nweiz 2013/04/18 22:50:03 Shouldn't it actually be empty? It seems like you
Bob Nystrom 2013/04/18 23:07:10 It will contain a request for the version list for
+ });
+ });
}
« utils/tests/pub/test_pub.dart ('K') | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698