have xcodeSelectPath also catch ArgumentError (#37521)
This commit is contained in:
committed by
GitHub
parent
40c5cc9708
commit
5fb2d2aeea
@@ -26,6 +26,8 @@ class Xcode {
|
|||||||
_xcodeSelectPath = processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']).stdout.trim();
|
_xcodeSelectPath = processManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']).stdout.trim();
|
||||||
} on ProcessException {
|
} on ProcessException {
|
||||||
// Ignored, return null below.
|
// Ignored, return null below.
|
||||||
|
} on ArgumentError {
|
||||||
|
// Ignored, return null below.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _xcodeSelectPath;
|
return _xcodeSelectPath;
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ void main() {
|
|||||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
when(mockProcessManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||||
.thenThrow(const ProcessException('/usr/bin/xcode-select', <String>['--print-path']));
|
.thenThrow(const ProcessException('/usr/bin/xcode-select', <String>['--print-path']));
|
||||||
expect(xcode.xcodeSelectPath, isNull);
|
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>{
|
}, overrides: <Type, Generator>{
|
||||||
ProcessManager: () => mockProcessManager,
|
ProcessManager: () => mockProcessManager,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user