Unverified Commit a440c468 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

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
parent 0943693e
......@@ -1921,14 +1921,17 @@ void main() {
// Run pub online first in order to populate the pub cache.
await runner.run(<String>['create', '--pub', projectDir.path]);
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
expect(loggingProcessManager.commands.first, isNot(contains('--offline')));
final RegExp dartCommand = RegExp(r'dart-sdk[\\/]bin[\\/]dart');
expect(loggingProcessManager.commands, contains(predicate(
(List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && !c.contains('--offline')
)));
// Run pub offline.
loggingProcessManager.clear();
await runner.run(<String>['create', '--pub', '--offline', projectDir.path]);
expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]dart')));
expect(loggingProcessManager.commands.first, contains('--offline'));
expect(loggingProcessManager.commands, contains(predicate(
(List<String> c) => dartCommand.hasMatch(c[0]) && c[1].contains('pub') && c.contains('--offline')
)));
},
overrides: <Type, Generator>{
ProcessManager: () => loggingProcessManager,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment