@Test
public void testSaveFile() throws IOException {

    File file = File.createTempFile("tmp", ".tmp");
    file.delete();
    file.mkdir();
    file.deleteOnExit();
    File child = new File(file, "child.txt");
    child.createNewFile();
    child.deleteOnExit();
    aeshContext.setCurrentWorkingDirectory(new FileResource(file));
    resource = aeshContext.getCurrentWorkingDirectory();
    FileUtils.saveFile(resource.list().get(0), "foo", false);
    File f = new File(resource.list().get(0).getAbsolutePath());
    Assert.assertEquals(new String(Files.readAllBytes(f.toPath())), "foo");
}