From f33785bf8af8035708bad785f46f394dfc9d2dcc Mon Sep 17 00:00:00 2001 From: Simon Brown <1009874+simonbrowndotje@users.noreply.github.com> Date: Sat, 2 Nov 2024 11:49:46 +0000 Subject: [PATCH] Fixes test failure on Windows. --- .../java/com/structurizr/cli/AbstractCommandTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/structurizr/cli/AbstractCommandTests.java b/src/test/java/com/structurizr/cli/AbstractCommandTests.java index 2a13e3d..996c545 100644 --- a/src/test/java/com/structurizr/cli/AbstractCommandTests.java +++ b/src/test/java/com/structurizr/cli/AbstractCommandTests.java @@ -2,17 +2,21 @@ import org.junit.jupiter.api.Test; +import java.io.File; + import static org.junit.jupiter.api.Assertions.*; public class AbstractCommandTests { @Test public void loadWorkspace_ThrowsAnException_WhenTheWorkspacePathIsADirectory() { + File file = new File("src/test/dsl"); try { - new ValidateCommand().loadWorkspace("src/test/dsl"); + + new ValidateCommand().loadWorkspace(file.getAbsolutePath()); fail(); } catch (Exception e) { - assertTrue(e.getMessage().endsWith("/src/test/dsl is not a JSON or DSL file")); + assertTrue(e.getMessage().endsWith(file.getAbsolutePath() + " is not a JSON or DSL file")); } }