mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
have xcodeSelectPath also catch ArgumentError (#37521)
This commit is contained in:
parent
40c5cc9708
commit
5fb2d2aeea
@ -26,6 +26,8 @@ class Xcode {
|
||||
_xcodeSelectPath = processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']).stdout.trim();
|
||||
} on ProcessException {
|
||||
// Ignored, return null below.
|
||||
} on ArgumentError {
|
||||
// Ignored, return null below.
|
||||
}
|
||||
}
|
||||
return _xcodeSelectPath;
|
||||
|
||||
@ -30,6 +30,9 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenThrow(const ProcessException('/usr/bin/xcode-select', <String>['--print-path']));
|
||||
expect(xcode.xcodeSelectPath, isNull);
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenThrow(ArgumentError('Invalid argument(s): Cannot find executable for /usr/bin/xcode-select'));
|
||||
expect(xcode.xcodeSelectPath, isNull);
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user