Skip to content

Commit

Permalink
Polish contribution
Browse files Browse the repository at this point in the history
Closes gh-8490
  • Loading branch information
snicoll committed Mar 10, 2017
1 parent a6f0da8 commit c8ac94b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -91,6 +91,9 @@ protected void releaseOutput() {
this.copy = null;
}

/**
* Discard all currently accumulated output.
*/
public void reset() {
this.copy.reset();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class OutputCaptureTests {
@Test
public void toStringShouldReturnAllCapturedOutput() throws Exception {
System.out.println("Hello World");

assertThat(this.outputCapture.toString()).contains("Hello World");
}

Expand All @@ -43,7 +42,6 @@ public void reset() throws Exception {
System.out.println("Hello");
this.outputCapture.reset();
System.out.println("World");

assertThat(this.outputCapture.toString()).doesNotContain("Hello")
.contains("World");
}
Expand Down

0 comments on commit c8ac94b

Please sign in to comment.