assertThat(stringWriter.toString(), is("First Line.\nSecond Line.\nFirst Line.\n"));
}
+ @Test
+ public void resettingTheWriterAllowsADuplicateLine() throws IOException {
+ duplicateLineSuppressingWriter.write("First Line.\n");
+ duplicateLineSuppressingWriter.write("Second Line.\n");
+ duplicateLineSuppressingWriter.reset();
+ duplicateLineSuppressingWriter.write("Second Line.\n");
+ assertThat(stringWriter.toString(), is("First Line.\nSecond Line.\nSecond Line.\n"));
+ }
+
}