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

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

Issue 12226077: add --preview flag to publish command (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_lish_test.dart
===================================================================
--- utils/tests/pub/pub_lish_test.dart (revision 18294)
+++ utils/tests/pub/pub_lish_test.dart (working copy)
@@ -81,9 +81,9 @@
// test that "pub lish" chooses the correct files to publish.
integration('package validation has an error', () {
- var package = package("test_pkg", "1.0.0");
- package.remove("homepage");
- dir(appPath, [pubspec(package)]).scheduleCreate();
+ var pkg = package("test_pkg", "1.0.0");
+ pkg.remove("homepage");
+ dir(appPath, [pubspec(pkg)]).scheduleCreate();
var server = new ScheduledServer();
var pub = startPubLish(server);
@@ -94,10 +94,42 @@
"published yet."));
});
+ integration('preview package validation has a warning', () {
+ var pkg = package("test_pkg", "1.0.0");
+ pkg["author"] = "Nathan Weizenbaum";
+ dir(appPath, [pubspec(pkg)]).scheduleCreate();
+
+ var server = new ScheduledServer();
+ var lishArgs = new List();
+ lishArgs.add("--dry-run");
Bob Nystrom 2013/02/11 18:44:37 Eek, Java! :) Just do: startPubLish(server, args
keertip 2013/02/11 23:57:31 Done.
+ var pub = startPubLish(server,args: lishArgs);
Bob Nystrom 2013/02/11 18:44:37 Space after ",".
keertip 2013/02/11 23:57:31 Done.
+
+ pub.shouldExit(0);
Bob Nystrom 2013/02/11 18:44:37 Do we want a zero exit code for this? It might be
+ expectLater(pub.remainingStderr(),
+ contains('Suggestions:\n* Author "Nathan Weizenbaum" in pubspec.yaml '
+ 'should have an email address\n (e.g. "name <email>").\n\n'
Bob Nystrom 2013/02/11 18:44:37 Extra leading space here. Also, I'd split it at th
+ 'Package has 1 warning.'));
+ });
+
+ integration('preview package validation has no warnings', () {
+ var pkg = package("test_pkg", "1.0.0");
+ pkg["author"] = "Nathan Weizenbaum <nweiz@google.com>";
+ dir(appPath, [pubspec(pkg)]).scheduleCreate();
+
+ var server = new ScheduledServer();
+ var lishArgs = new List();
+ lishArgs.add("--dry-run");
+ var pub = startPubLish(server,args: lishArgs);
Bob Nystrom 2013/02/11 18:44:37 lishArgs -> ['--dry-run']
keertip 2013/02/11 23:57:31 Done.
+
+ pub.shouldExit(0);
+ expectLater(pub.remainingStderr(),
+ contains('Package has 0 warnings.'));
+ });
+
integration('package validation has a warning and is canceled', () {
- var package = package("test_pkg", "1.0.0");
- package["author"] = "Nathan Weizenbaum";
- dir(appPath, [pubspec(package)]).scheduleCreate();
+ var pkg = package("test_pkg", "1.0.0");
+ pkg["author"] = "Nathan Weizenbaum";
+ dir(appPath, [pubspec(pkg)]).scheduleCreate();
var server = new ScheduledServer();
var pub = startPubLish(server);
@@ -108,9 +140,9 @@
});
integration('package validation has a warning and continues', () {
- var package = package("test_pkg", "1.0.0");
- package["author"] = "Nathan Weizenbaum";
- dir(appPath, [pubspec(package)]).scheduleCreate();
+ var pkg = package("test_pkg", "1.0.0");
+ pkg["author"] = "Nathan Weizenbaum";
+ dir(appPath, [pubspec(pkg)]).scheduleCreate();
var server = new ScheduledServer();
credentialsFile(server, 'access token').scheduleCreate();

Powered by Google App Engine
This is Rietveld 408576698