fixing linux tests

This commit is contained in:
kay.one 2013-07-25 22:00:57 -07:00
parent 9330f0aefc
commit 05370518c5
6 changed files with 53 additions and 19 deletions

View file

@ -0,0 +1,22 @@
using System.IO;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Test.Common
{
public static class StringExtensions
{
public static string AsOsAgnostic(this string path)
{
if (OsInfo.IsLinux)
{
if (path.Length > 2 && path[1] == ':')
{
path = path.Replace(':', Path.DirectorySeparatorChar);
}
path = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
}
return path;
}
}
}