mono version check will support 3 digit versions

This commit is contained in:
Mark McDowall 2014-03-14 13:20:31 -07:00
parent 088028b426
commit 7445adb455
2 changed files with 17 additions and 1 deletions

View File

@ -62,5 +62,21 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
Subject.Check().Should().BeNull();
}
[Test]
public void should_return_null_when_mono_3_2_7()
{
GivenOutput("3.2.7");
Subject.Check().Should().BeNull();
}
[Test]
public void should_return_null_when_mono_3_2_1()
{
GivenOutput("3.2.1");
Subject.Check().Should().BeNull();
}
}
}

View File

@ -10,7 +10,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
{
private readonly IProcessProvider _processProvider;
private readonly Logger _logger;
private static readonly Regex VersionRegex = new Regex(@"(?<=\W)(?<version>\d+\.\d+\.\d+\.\d+)(?=\W)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex VersionRegex = new Regex(@"(?<=\W)(?<version>\d+\.\d+\.\d+(\.\d+)?)(?=\W)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public MonoVersionCheck(IProcessProvider processProvider, Logger logger)
{