Add test for unknown Xcode version string (#10979)
Also, correct an existing test description.
This commit is contained in:
@@ -100,7 +100,7 @@ void main() {
|
||||
ProcessManager: () => mockProcessManager,
|
||||
});
|
||||
|
||||
testUsingContext('xcodeVersionText returns null when xcodebuild is not installed', () {
|
||||
testUsingContext('xcodeVersionText returns formatted version text', () {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
|
||||
.thenReturn(new ProcessResult(1, 0, 'Xcode 8.3.3\nBuild version 8E3004b', ''));
|
||||
expect(xcode.xcodeVersionText, 'Xcode 8.3.3, Build version 8E3004b');
|
||||
@@ -108,6 +108,14 @@ void main() {
|
||||
ProcessManager: () => mockProcessManager,
|
||||
});
|
||||
|
||||
testUsingContext('xcodeVersionText handles Xcode version string with unexpected format', () {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
|
||||
.thenReturn(new ProcessResult(1, 0, 'Xcode Ultra5000\nBuild version 8E3004b', ''));
|
||||
expect(xcode.xcodeVersionText, 'Xcode Ultra5000, Build version 8E3004b');
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
});
|
||||
|
||||
testUsingContext('eulaSigned is false when clang is not installed', () {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcrun', 'clang']))
|
||||
.thenThrow(const ProcessException('/usr/bin/xcrun', const <String>['clang']));
|
||||
|
||||
Reference in New Issue
Block a user