Commit b8c532d5 authored by Rajiv Prabhakar's avatar Rajiv Prabhakar
Browse files

v1.7.1 patch: FileUtilc unit test fix, to enable gitlab-ci support

parent ac9f00cc
Pipeline #9586713 passed with stage
in 1 minute and 16 seconds
......@@ -6,7 +6,7 @@
<groupId>com.rajivprab</groupId>
<artifactId>cava</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
<name>Cava: Clean Java</name>
<description>A library that enables users to write minimal, clean and simple Java code</description>
......
......@@ -6,6 +6,9 @@ import org.junit.Test;
import org.rajivprab.cava.IOUtilc.IoException;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
/**
* Unit tests for FileUtilc
......@@ -34,11 +37,16 @@ public class FileUtilcTest extends TestBase {
}
}
// Test may need to be updated to work on all other systems
@Test
public void readSystemFile() {
Truth.assertThat(FileUtilc.readFileToString(new File("/etc/defaults/periodic.conf")))
.contains("# Daily options");
File file = new File("/tmp/tmp-cava-readSystemFile.txt");
file.deleteOnExit();
try (Writer writer = new FileWriter(file)) {
writer.write("readSystemFile test");
} catch (IOException e) {
throw new IoException(e);
}
Truth.assertThat(FileUtilc.readFileToString(file)).contains("readSystemFile test");
}
@Test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment