Files
dragoon/src/test/java/tech/bitgoblin/io/IOUtilsTest.java
Gregory Ballantine 347211d566
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Cleaned up the IOUtilsTest class a bit
2022-05-03 00:17:50 -04:00

37 lines
731 B
Java

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