@Test
public void cli() throws Exception {

    final String input = "help\n" + "test\n" + "test | jgrep 2\n" + "exit";
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final CrestCli cli = newTestCli(input, out, null);
    cli.run();
    assertEquals(
        portable("prompt$help\n" +
        "Commands: \n" +
        "                       \n" +
        "   clear               \n" +
        "   exit                \n" +
        "   help                \n" +
        "   history             \n" +
        "   jgrep               \n" +
        "   jsed                \n" +
        "   pretty              \n" +
        "   test                \n" +
        "   wc                  \n" +
        "\n" +
        "prompt$test\n" +
        "line1\n" +
        "line 2\n" +
        "end\n" +
        "\n" +
        "prompt$test | jgrep 2\n" +
        "line 2\n" +
        "prompt$exit"), portable(new String(out.toByteArray())));
}