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

Unified Diff: sdk/lib/_internal/pub/test/serve/installs_first_if_dependency_added_test.dart

Issue 21147002: Install before starting the server if the lockfile is out of date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 5 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: sdk/lib/_internal/pub/test/serve/installs_first_if_dependency_added_test.dart
diff --git a/sdk/lib/_internal/pub/test/serve/missing_dependency_file_test.dart b/sdk/lib/_internal/pub/test/serve/installs_first_if_dependency_added_test.dart
similarity index 57%
copy from sdk/lib/_internal/pub/test/serve/missing_dependency_file_test.dart
copy to sdk/lib/_internal/pub/test/serve/installs_first_if_dependency_added_test.dart
index d1c47f24e8946cccca4545d3669afe06b403fde3..42bcdfd91bb7dc8e06f9c7c698c17f8d552c99a3 100644
--- a/sdk/lib/_internal/pub/test/serve/missing_dependency_file_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/installs_first_if_dependency_added_test.dart
@@ -5,6 +5,7 @@
library pub_tests;
import 'dart:io';
+import 'dart:json' as json;
import '../descriptor.dart' as d;
import '../test_pub.dart';
@@ -12,23 +13,27 @@ import 'utils.dart';
main() {
initConfig();
- integration("responds with a 404 for a missing files in dependencies", () {
+ integration("installs first if a dependency is not in the lock file", () {
d.dir("foo", [
- d.libPubspec("foo", "0.0.1")
+ d.libPubspec("foo", "0.0.1"),
+ d.libDir("foo")
]).create();
+ // Create a lock file without "foo".
+ d.dir(appPath, [
+ d.appPubspec()
+ ]).create();
+ pubInstall();
+
+ // Add it to the pubspec.
d.dir(appPath, [
d.appPubspec({
"foo": {"path": "../foo"}
})
]).create();
- pubInstall();
- startPubServe();
- requestShould404("packages/foo/nope.dart");
- requestShould404("assets/foo/nope.png");
- requestShould404("dir/packages/foo/nope.dart");
- requestShould404("dir/assets/foo/nope.png");
+ startPubServe(shouldInstallFirst: true);
+ requestShouldSucceed("packages/foo/foo.dart", 'main() => "foo";');
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698