Do not assume that pub is the first command run by "flutter create" (#114621)
The "flutter create" command on macOS may run other commands such as openssl when it calls _getCodeSigningIdentityDevelopmentTeam
This commit is contained in:
parent
0943693e85
commit
a440c4689f
@ -1921,14 +1921,17 @@ void main() {
|
|||||||
|
|
||||||
// Run pub online first in order to populate the pub cache.
|
// Run pub online first in order to populate the pub cache.
|
||||||
await runner.run(<String>['create', '--pub', projectDir.path]);
|
await runner.run(<String>['create', '--pub', projectDir.path]);
|
||||||
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
|
final RegExp dartCommand = RegExp(r'dart-sdk[\\/]bin[\\/]dart');
|
||||||
expect(loggingProcessManager.commands.first, isNot(contains('--offline')));
|
expect(loggingProcessManager.commands, contains(predicate(
|
||||||
|
(List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && !c.contains('--offline')
|
||||||
|
)));
|
||||||
|
|
||||||
// Run pub offline.
|
// Run pub offline.
|
||||||
loggingProcessManager.clear();
|
loggingProcessManager.clear();
|
||||||
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
|
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
|
||||||
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
|
expect(loggingProcessManager.commands, contains(predicate(
|
||||||
expect(loggingProcessManager.commands.first, contains('--offline'));
|
(List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && c.contains('--offline')
|
||||||
|
)));
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{
|
overrides: <Type, Generator>{
|
||||||
ProcessManager: () => loggingProcessManager,
|
ProcessManager: () => loggingProcessManager,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user