All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
37 lines
731 B
Java
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();
|
|
}
|
|
|
|
}
|