Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created January 10, 2014 04:04
Show Gist options
  • Save tarynsauer/8346835 to your computer and use it in GitHub Desktop.
Save tarynsauer/8346835 to your computer and use it in GitHub Desktop.
public class CLIBoardTest {
private CLIBoard cliBoard;
private MockPrintStream printStream;
@Before
public void setUp() throws Exception {
MockOutputStream outputStream = new MockOutputStream();
printStream = new MockPrintStream(outputStream);
printStream.setPrintCallHistory(new ArrayList<String>());
cliBoard = new CLIBoard(printStream);
}
@Test
public void testPrintDivider() {
String expectedOutput = "------------------\n";
cliBoard.printDivider();
assertEquals(expectedOutput, printStream.lastPrintCall());
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment