Commit 5141c1e8 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Add test for unknown Xcode version string (#10979)

Also, correct an existing test description.
parent dbb734dd
......@@ -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']));
......
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