@@ -115,7 +115,7 @@ void main() {
115
115
116
116
test (
117
117
'help' ,
118
- withRunner ((commandRunner, logger, printLogs) async {
118
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
119
119
final result = await commandRunner.run (['create' , '--help' ]);
120
120
expect (printLogs, equals (expectedUsage));
121
121
expect (result, equals (ExitCode .success.code));
@@ -136,7 +136,7 @@ void main() {
136
136
test (
137
137
'throws UsageException when --project-name is missing '
138
138
'and directory base is not a valid package name' ,
139
- withRunner ((commandRunner, logger, printLogs) async {
139
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
140
140
const expectedErrorMessage = '".tmp" is not a valid package name.\n\n '
141
141
'See https://dart.dev/tools/pub/pubspec#name for more information.' ;
142
142
final result = await commandRunner.run (['create' , '.tmp' ]);
@@ -147,7 +147,7 @@ void main() {
147
147
148
148
test (
149
149
'throws UsageException when --project-name is invalid' ,
150
- withRunner ((commandRunner, logger, printLogs) async {
150
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
151
151
const expectedErrorMessage = '"My App" is not a valid package name.\n\n '
152
152
'See https://dart.dev/tools/pub/pubspec#name for more information.' ;
153
153
final result = await commandRunner.run (
@@ -160,7 +160,7 @@ void main() {
160
160
161
161
test (
162
162
'throws UsageException when output directory is missing' ,
163
- withRunner ((commandRunner, logger, printLogs) async {
163
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
164
164
const expectedErrorMessage =
165
165
'No option specified for the output directory.' ;
166
166
final result = await commandRunner.run (['create' ]);
@@ -171,7 +171,7 @@ void main() {
171
171
172
172
test (
173
173
'throws UsageException when multiple output directories are provided' ,
174
- withRunner ((commandRunner, logger, printLogs) async {
174
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
175
175
const expectedErrorMessage = 'Multiple output directories specified.' ;
176
176
final result = await commandRunner.run (['create' , './a' , './b' ]);
177
177
expect (result, equals (ExitCode .usage.code));
@@ -322,7 +322,7 @@ void main() {
322
322
test (
323
323
'is a valid alias' ,
324
324
withRunner (
325
- (commandRunner, logger, printLogs) async {
325
+ (commandRunner, logger, pubUpdater, printLogs) async {
326
326
const orgName = 'com.my.org' ;
327
327
final tempDir = Directory .systemTemp.createTempSync ();
328
328
final result = await commandRunner.run (
@@ -347,7 +347,7 @@ void main() {
347
347
348
348
test (
349
349
'no delimiters' ,
350
- withRunner ((commandRunner, logger, printLogs) async {
350
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
351
351
const orgName = 'My App' ;
352
352
final result = await commandRunner.run (
353
353
['create' , '.' , '--org-name' , orgName],
@@ -359,7 +359,7 @@ void main() {
359
359
360
360
test (
361
361
'less than 2 domains' ,
362
- withRunner ((commandRunner, logger, printLogs) async {
362
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
363
363
const orgName = 'verybadtest' ;
364
364
final result = await commandRunner.run (
365
365
['create' , '.' , '--org-name' , orgName],
@@ -371,7 +371,7 @@ void main() {
371
371
372
372
test (
373
373
'invalid characters present' ,
374
- withRunner ((commandRunner, logger, printLogs) async {
374
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
375
375
const orgName = 'very%.bad@.#test' ;
376
376
final result = await commandRunner.run (
377
377
['create' , '.' , '--org-name' , orgName],
@@ -383,7 +383,7 @@ void main() {
383
383
384
384
test (
385
385
'segment starts with a non-letter' ,
386
- withRunner ((commandRunner, logger, printLogs) async {
386
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
387
387
const orgName = 'very.bad.1test' ;
388
388
final result = await commandRunner.run (
389
389
['create' , '.' , '--org-name' , orgName],
@@ -395,7 +395,7 @@ void main() {
395
395
396
396
test (
397
397
'valid prefix but invalid suffix' ,
398
- withRunner ((commandRunner, logger, printLogs) async {
398
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
399
399
const orgName = 'very.good.prefix.bad@@suffix' ;
400
400
final result = await commandRunner.run (
401
401
['create' , '.' , '--org-name' , orgName],
@@ -498,7 +498,7 @@ void main() {
498
498
group ('invalid template name' , () {
499
499
test (
500
500
'invalid template name' ,
501
- withRunner ((commandRunner, logger, printLogs) async {
501
+ withRunner ((commandRunner, logger, pubUpdater, printLogs) async {
502
502
const templateName = 'badtemplate' ;
503
503
const expectedErrorMessage =
504
504
'''"$templateName " is not an allowed value for option "template".''' ;
0 commit comments