Add tests for iOS doctor validaton (#7794)

This commit is contained in:
Chris Bracken
2017-02-01 15:58:40 -08:00
committed by GitHub
parent b082b93a3f
commit 18fcb91e88
2 changed files with 126 additions and 2 deletions

View File

@@ -38,6 +38,8 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
String get iosDeployVersionText => runSync(<String>['ios-deploy', '--version']).replaceAll('\n', '');
bool get hasHomebrew => os.which('brew') != null;
bool get _iosDeployIsInstalledAndMeetsVersionCheck {
if (!hasIosDeploy)
return false;
@@ -89,7 +91,7 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
}
// brew installed
if (os.which('brew') != null) {
if (hasHomebrew) {
brewStatus = ValidationType.installed;
if (!exitsHappy(<String>['ideviceinstaller', '-h'])) {
@@ -132,9 +134,13 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
}
return new ValidationResult(
xcodeStatus == brewStatus ? xcodeStatus : ValidationType.partial,
<ValidationType>[xcodeStatus, brewStatus].reduce(_mergeValidationTypes),
messages,
statusInfo: xcodeVersionInfo
);
}
ValidationType _mergeValidationTypes(ValidationType t1, ValidationType t2) {
return t1 == t2 ? t1 : ValidationType.partial;
}
}