Added some tests for the IOUtil class
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
28
src/test/java/tech/bitgoblin/io/IOUtilsTest.java
Normal file
28
src/test/java/tech/bitgoblin/io/IOUtilsTest.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user