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

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

Issue 10874051: Support self-referential package: imports with Pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 8 years, 4 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
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_test.dart
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
index 34046bd345a451d99f83d00df2264ceb7c3a64ac..2f99b6849ea1c6bfc56eb10b5221916998646645 100644
--- a/utils/tests/pub/pub_test.dart
+++ b/utils/tests/pub/pub_test.dart
@@ -90,6 +90,45 @@ listCommand() {
}
installCommand() {
+ group('requires', () {
+ test('a pubspec', () {
+ dir(appPath, []).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ error: const RegExp(@'^Could not find a file named "pubspec.yaml"'));
+
+ run();
+ });
+
+ test('a pubspec with a "name" key', () {
+ dir(appPath, [
+ pubspec({"dependencies": {"foo": null}})
+ ]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ error: const RegExp(@'^"pubspec.yaml" must contain a "name" key\.'));
+
+ run();
+ });
+ });
+
+ test('creates a self-referential symlink', () {
+ // The symlink should use the name in the pubspec, not the name of the
+ // directory.
+ dir(appPath, [
+ pubspec({"name": "myapp_name"})
+ ]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir("myapp_name", [pubspec({"name": "myapp_name"})])
+ ]).scheduleValidate();
+
+ run();
+ });
+
test('checks out a package from the SDK', () {
dir(sdkPath, [
file('revision', '1234'),
@@ -97,7 +136,7 @@ installCommand() {
]).scheduleCreate();
dir(appPath, [
- pubspec({"dependencies": {"foo": null}})
+ pubspec({"name": "myapp", "dependencies": {"foo": null}})
]).scheduleCreate();
schedulePub(args: ['install'],
@@ -633,6 +672,28 @@ installCommand() {
}
updateCommand() {
+ group('requires', () {
+ test('a pubspec', () {
+ dir(appPath, []).scheduleCreate();
+
+ schedulePub(args: ['update'],
+ error: const RegExp(@'^Could not find a file named "pubspec.yaml"'));
+
+ run();
+ });
+
+ test('a pubspec with a "name" key', () {
+ dir(appPath, [
+ pubspec({"dependencies": {"foo": null}})
+ ]).scheduleCreate();
+
+ schedulePub(args: ['update'],
+ error: const RegExp(@'^"pubspec.yaml" must contain a "name" key\.'));
+
+ run();
+ });
+ });
+
test("updates locked Git packages", () {
ensureGit();
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698