Commit bb732b46 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Add tests for xcodeVersionSatisfactory (#10981)

And fix a typo in a test description.
parent e04907a4
......@@ -148,7 +148,7 @@ void main() {
ProcessManager: () => mockProcessManager,
});
testUsingContext('xcodeMajorVersion is null when version has unexpected format', () {
testUsingContext('xcodeMinorVersion is null when version has unexpected format', () {
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
.thenReturn(new ProcessResult(1, 0, 'Xcode Ultra5000\nBuild version 8E3004b', ''));
expect(xcode.xcodeMinorVersion, isNull);
......@@ -156,6 +156,38 @@ void main() {
ProcessManager: () => mockProcessManager,
});
testUsingContext('xcodeVersionSatisfactory is false when version is less than minimum', () {
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
.thenReturn(new ProcessResult(1, 0, 'Xcode 7.0.1\nBuild version 7A1001', ''));
expect(xcode.xcodeVersionSatisfactory, isFalse);
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
});
testUsingContext('xcodeVersionSatisfactory is false when version in unknown format', () {
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
.thenReturn(new ProcessResult(1, 0, 'Xcode SuperHD\nBuild version 7A1001', ''));
expect(xcode.xcodeVersionSatisfactory, isFalse);
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
});
testUsingContext('xcodeVersionSatisfactory is true when version meets minimum', () {
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
.thenReturn(new ProcessResult(1, 0, 'Xcode 8.3.3\nBuild version 8E3004b', ''));
expect(xcode.xcodeVersionSatisfactory, isTrue);
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
});
testUsingContext('xcodeVersionSatisfactory is true when version exceeds minimum', () {
when(mockProcessManager.runSync(<String>['/usr/bin/xcodebuild', '-version']))
.thenReturn(new ProcessResult(1, 0, 'Xcode 9.0\nBuild version 9M137d', ''));
expect(xcode.xcodeVersionSatisfactory, isTrue);
}, 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