more linux fixes

pull/3113/head
kay.one 11 years ago
parent 035434468e
commit aee31d1bc2

@ -79,7 +79,7 @@ namespace NzbDrone.Common.Test
}
[Test]
public void get_actual_casing_should_return_actual_casing_for_local_file()
public void get_actual_casing_should_return_actual_casing_for_local_file_in_windows()
{
var path = Process.GetCurrentProcess().MainModule.FileName;
path.ToUpper().GetActualCasing().Should().Be(path);
@ -87,14 +87,32 @@ namespace NzbDrone.Common.Test
}
[Test]
public void get_actual_casing_should_return_actual_casing_for_local_dir()
public void get_actual_casing_should_return_origibal_value_in_linux()
{
var path = Process.GetCurrentProcess().MainModule.FileName;
path.GetActualCasing().Should().Be(path);
path.GetActualCasing().Should().Be(path);
}
[Test]
public void get_actual_casing_should_return_actual_casing_for_local_dir_in_windows()
{
WindowsOnly();
var path = Directory.GetCurrentDirectory();
path.ToUpper().GetActualCasing().Should().Be(path);
path.ToLower().GetActualCasing().Should().Be(path);
}
[Test]
public void get_actual_casing_should_return_original_value_in_linux()
{
WindowsOnly();
var path = Directory.GetCurrentDirectory();
path.GetActualCasing().Should().Be(path);
path.GetActualCasing().Should().Be(path);
}
[Test]
[Explicit]
public void get_actual_casing_should_return_original_casing_for_shares()
@ -103,9 +121,6 @@ namespace NzbDrone.Common.Test
path.GetActualCasing().Should().Be(path);
}
[Test]
public void AppDataDirectory_path_test()
{

@ -22,8 +22,9 @@ namespace NzbDrone.Common
public static string CleanFilePath(this string path)
{
Ensure.That(() => path).IsNotNullOrWhiteSpace();
Ensure.That(() => path).IsValidPath();
var info = new FileInfo(path);
var info = new FileInfo(path.Trim());
if (!OsInfo.IsLinux && info.FullName.StartsWith(@"\\")) //UNC
{

Loading…
Cancel
Save