@Test public void shouldProperlyShowHelpMessage() { InputStream stream = toInputStream( "help\n" + "clear\n"); ByteArrayOutputStream result = new ByteArrayOutputStream(); new Shell(stream, result, "") { @Override public List<Object> buildCommands(JCommander jCommander) { return Arrays.<Object>asList( new Help(jCommander), new Clear(this) ); } }.run(); approval.verify(result, Paths.get("")); }
@Override public void run() { try { boolean b = shell.getConsoleReader().clearScreen(); if (!b) { shell.getOutput().print(COULDN_T_CLEAR_THE_SCREEN); } } catch (IOException e) { shell.getOutput().println(COULDN_T_CLEAR_THE_SCREEN + ": " + e.getMessage()); } }
Clear implements ShellCommand { @Override public void run() { try { boolean b = shell.getConsoleReader().clearScreen(); if (!b) { shell.getOutput().print(COULDN_T_CLEAR_THE_SCREEN); } } catch (IOException e) { shell.getOutput().println(COULDN_T_CLEAR_THE_SCREEN + ": " + e.getMessage()); } } }
Clear implements ShellCommand { @Override public void run() { try { boolean b = shell.getConsoleReader().clearScreen(); if (!b) { shell.getOutput().print(COULDN_T_CLEAR_THE_SCREEN); } } catch (IOException e) { shell.getOutput().println(COULDN_T_CLEAR_THE_SCREEN + ": " + e.getMessage()); } } Clear(Shell shell); }
Clear implements ShellCommand { @Override public void run() { try { boolean b = shell.getConsoleReader().clearScreen(); if (!b) { shell.getOutput().print(COULDN_T_CLEAR_THE_SCREEN); } } catch (IOException e) { shell.getOutput().println(COULDN_T_CLEAR_THE_SCREEN + ": " + e.getMessage()); } } Clear(Shell shell); @Override void run(); }
Clear implements ShellCommand { @Override public void run() { try { boolean b = shell.getConsoleReader().clearScreen(); if (!b) { shell.getOutput().print(COULDN_T_CLEAR_THE_SCREEN); } } catch (IOException e) { shell.getOutput().println(COULDN_T_CLEAR_THE_SCREEN + ": " + e.getMessage()); } } Clear(Shell shell); @Override void run();  }