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

Side by Side Diff: utils/tests/pub/pub_test.dart

Issue 12217156: Add --force to pub lish. (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub_tests; 5 library pub_tests;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'test_pub.dart'; 9 import 'test_pub.dart';
10 import '../../../pkg/unittest/lib/unittest.dart'; 10 import '../../../pkg/unittest/lib/unittest.dart';
(...skipping 25 matching lines...) Expand all
36 36
37 Use "pub help [command]" for more information about a command. 37 Use "pub help [command]" for more information about a command.
38 """; 38 """;
39 39
40 final VERSION_STRING = ''' 40 final VERSION_STRING = '''
41 Pub 0.1.2+3 41 Pub 0.1.2+3
42 '''; 42 ''';
43 43
44 main() { 44 main() {
45 initConfig(); 45 initConfig();
46 46
47 integration('running pub with no command displays usage', () { 47 integration('running pub with no command displays usage', () {
48 schedulePub(args: [], output: USAGE_STRING); 48 schedulePub(args: [], output: USAGE_STRING);
49 }); 49 });
50 50
51 integration('running pub with just --help displays usage', () { 51 integration('running pub with just --help displays usage', () {
52 schedulePub(args: ['--help'], output: USAGE_STRING); 52 schedulePub(args: ['--help'], output: USAGE_STRING);
53 }); 53 });
54 54
55 integration('running pub with just -h displays usage', () { 55 integration('running pub with just -h displays usage', () {
56 schedulePub(args: ['-h'], output: USAGE_STRING); 56 schedulePub(args: ['-h'], output: USAGE_STRING);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 '''); 99 ''');
100 }); 100 });
101 101
102 integration('shows help for a command', () { 102 integration('shows help for a command', () {
103 schedulePub(args: ['help', 'publish'], 103 schedulePub(args: ['help', 'publish'],
104 output: ''' 104 output: '''
105 Publish the current package to pub.dartlang.org. 105 Publish the current package to pub.dartlang.org.
106 106
107 Usage: pub publish [options] 107 Usage: pub publish [options]
108 -n, --dry-run Validate but do not publish the package 108 -n, --dry-run Validate but do not publish the package
109 -f, --force Publish without confirmation if there are no errors
109 --server The package server to which to upload this package 110 --server The package server to which to upload this package
110 (defaults to "https://pub.dartlang.org") 111 (defaults to "https://pub.dartlang.org")
111 '''); 112 ''');
112 }); 113 });
113 114
114 integration('an unknown help command displays an error message', () { 115 integration('an unknown help command displays an error message', () {
115 schedulePub(args: ['help', 'quylthulg'], 116 schedulePub(args: ['help', 'quylthulg'],
116 error: ''' 117 error: '''
117 Could not find a command named "quylthulg". 118 Could not find a command named "quylthulg".
118 Run "pub help" to see available commands. 119 Run "pub help" to see available commands.
(...skipping 20 matching lines...) Expand all
139 // The "version" file generated on developer builds is a little funky and 140 // The "version" file generated on developer builds is a little funky and
140 // we need to make sure we don't choke on it. 141 // we need to make sure we don't choke on it.
141 dir(sdkPath, [ 142 dir(sdkPath, [
142 file('version', '0.1.2.0_r16279_bobross'), 143 file('version', '0.1.2.0_r16279_bobross'),
143 ]).scheduleCreate(); 144 ]).scheduleCreate();
144 145
145 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); 146 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n");
146 }); 147 });
147 }); 148 });
148 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698