Skip to content

Commit 057f208

Browse files
committed
Add test to ensure VersionFile.GetVersion outputs an absolute path
1 parent d7059f7 commit 057f208

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/NerdBank.GitVersioning.Tests/VersionFileTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@ VersionOptions GetOption(string path)
597597
}
598598
}
599599

600+
[Fact]
601+
public void GetVersion_ProducesAbsolutePath()
602+
{
603+
this.InitializeSourceControl();
604+
this.WriteVersionFile();
605+
Assert.NotNull(this.Context.VersionFile.GetVersion(out string actualDirectory));
606+
Assert.True(Path.IsPathRooted(actualDirectory));
607+
}
608+
600609
private void AssertPathHasVersion(string committish, string absolutePath, VersionOptions expected)
601610
{
602611
var actual = this.GetVersionOptions(absolutePath, committish);

0 commit comments

Comments
 (0)