Update Console::getHistory() to take the historyFile as input
This will make this method easier to test.
@@ -360,9 +360,13 @@ public class Console
}
private static MemoryHistory getHistory()
+ {
+ return getHistory(new File(getUserHome(), ".presto_history"));
+ }
+
+ private static MemoryHistory getHistory(File historyFile)
{
MemoryHistory history;
- File historyFile = new File(getUserHome(), ".presto_history");
try {
history = new FileHistory(historyFile);
history.setMaxSize(10000);
