File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
main/java/org/springframework/boot/test/rule
test/java/org/springframework/boot/test/rule Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2016 the original author or authors.
2
+ * Copyright 2012-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -91,6 +91,9 @@ protected void releaseOutput() {
91
91
this .copy = null ;
92
92
}
93
93
94
+ /**
95
+ * Discard all currently accumulated output.
96
+ */
94
97
public void reset () {
95
98
this .copy .reset ();
96
99
}
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ public class OutputCaptureTests {
34
34
@ Test
35
35
public void toStringShouldReturnAllCapturedOutput () throws Exception {
36
36
System .out .println ("Hello World" );
37
-
38
37
assertThat (this .outputCapture .toString ()).contains ("Hello World" );
39
38
}
40
39
@@ -43,7 +42,6 @@ public void reset() throws Exception {
43
42
System .out .println ("Hello" );
44
43
this .outputCapture .reset ();
45
44
System .out .println ("World" );
46
-
47
45
assertThat (this .outputCapture .toString ()).doesNotContain ("Hello" )
48
46
.contains ("World" );
49
47
}
You can’t perform that action at this time.
0 commit comments