Added some tests for the IOUtil class
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2022-05-03 00:13:34 -04:00
parent 26ec5d2782
commit 204a5e15f1
3 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,28 @@
package tech.bitgoblin.io;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import java.io.File;
public class IOUtilsTest {
@Test
public void shouldCreateDirectory() {
IOUtils.createDirectory("test-temp.txt");
assertTrue(new File("test-temp.txt").exists());
}
@Test
public void shouldExpandTilda() {
String homeExpanded = IOUtils.resolveTilda("~");
assertTrue(!homeExpanded.equals("~"));
}
@Test(expected=UnsupportedOperationException.class)
public void shouldFailExpandExplicitTilda() {
IOUtils.resolveTilda("~test");
}
}