Skip to content

Commit 8d946ff

Browse files
committed
chore: add a test
1 parent ec5efbd commit 8d946ff

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/src/test/java/io/snyk/languageserver/LsRuntimeEnvironmentTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.osgi.framework.Version;
1919

2020
import java.util.HashMap;
21+
import java.util.Optional;
2122

2223
import static org.junit.jupiter.api.Assertions.assertEquals;
2324
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -145,4 +146,14 @@ void testEnableTelemetryIsAddedToEnvironmentDisabled() throws StorageException {
145146
// This is a bit confusing - CLI takes DISABLE as env variable, but we ask for ENABLE, so it's reverted
146147
assertEquals("1", env.get(Preferences.ENABLE_TELEMETRY));
147148
}
149+
@Test
150+
void testAddPath() throws StorageException {
151+
String expected = "C;/myPath/:";
152+
HashMap<String, String> env = new HashMap<>();
153+
when(preferenceMock.getPath()).thenReturn(Optional.of(expected));
154+
155+
environment.addPath(env);
156+
157+
assert(env.get("PATH").startsWith(expected));
158+
}
148159
}

0 commit comments

Comments
 (0)