Skip to content

Commit

Permalink
Merge #2778 Fix fake/clone tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jun 11, 2019
2 parents 7f14638 + 8c13063 commit a1639b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file.
- [Multiple] Don't throw exceptions for dependency conflicts (#2766 by: HebaruSan; reviewed: DasSkelett)
- [Build] Update packages (#2775 by: Olympic1; reviewed: DasSkelett, HebaruSan)
- [Core] Suppress autostart warning (#2776 by: HebaruSan; reviewed: DasSkelett)
- [Build] Fix fake/clone tests on Windows (#2778 by: HebaruSan; reviewed: DasSkelett)

## v1.26.2

Expand Down
7 changes: 4 additions & 3 deletions Tests/Core/KSPManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ public void CloneInstance_BadInstance_ThrowsNotKSPDirKraken()
}

[Test]
public void CloneInstance_ToNotEmptyFolder_ThrowsIOException()
public void CloneInstance_ToNotEmptyFolder_ThrowsPathErrorKraken()
{
using (var KSP = new DisposableKSP())
{
string instanceName = "newInstance";
string tempdir = TestData.NewTempDir();
System.IO.File.Create(System.IO.Path.Combine(tempdir, "shouldntbehere.txt"));
System.IO.File.Create(System.IO.Path.Combine(tempdir, "shouldntbehere.txt")).Close();

Assert.Throws<PathErrorKraken>(() =>
manager.CloneInstance(KSP.KSP, instanceName, tempdir));
Expand Down Expand Up @@ -184,7 +184,7 @@ public void FakeInstance_InNotEmptyFolder_ThrowsBadInstallLocationKraken()
string name = "testname";
string tempdir = TestData.NewTempDir();
CKAN.Versioning.KspVersion version = CKAN.Versioning.KspVersion.Parse("1.5.1");
System.IO.File.Create(System.IO.Path.Combine(tempdir, "shouldntbehere.txt"));
System.IO.File.Create(System.IO.Path.Combine(tempdir, "shouldntbehere.txt")).Close();

Assert.Throws<BadInstallLocationKraken>(() =>
manager.FakeInstance(name, tempdir, version));
Expand All @@ -211,6 +211,7 @@ public void FakeInstance_ValidArgumentsWithDLC_ManagerHasValidInstance()
Assert.IsTrue(dlcVersionObject.ToString().Contains(dlcVersion));

// Tidy up.
CKAN.RegistryManager.Instance(newKSP).ReleaseLock();
System.IO.Directory.Delete(tempdir, true);
}

Expand Down

0 comments on commit a1639b5

Please sign in to comment.