public void Should_expand_a_pattern_to_its_absolute_path() { // Arrange Glob empty = null; Glob sampleFile = Path.GetTempFileName(); Glob root = Path.Combine("C:\\", "websites", "coolapp.com", "src", "wwwroot"); // Act var case1 = ((Glob)@"..\Views").Expand(root); var case2 = new Glob("../../index.html").Expand(root); var case3 = ((Glob)"..\\file.tmp").Expand(@"%TEMP%\foo", true); var case4 = ((Glob)"../").Expand(@"%TEMP%\foo", expandVariables: false); var case5 = empty.Expand(root); var case6 = sampleFile.Expand(root); // Assert case1.ShouldEndWith(@"src\Views"); case2.ShouldEndWith("coolapp.com\\index.html"); case3.ShouldContain(Environment.ExpandEnvironmentVariables("%TEMP%")); case4.ShouldBe("%TEMP%"); case5.ShouldBe(root); case6.ShouldBe(sampleFile); }