Skip to content

Commit

Permalink
Merge branch '2.7.x'
Browse files Browse the repository at this point in the history
Closes gh-33416
  • Loading branch information
philwebb committed Nov 29, 2022
2 parents 67c9c73 + e56156c commit e1efdad
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ public void toStringShouldReturnAllCapturedOutput() {
assertThat(this.output.toString()).contains("Hello World");
}

@Test
public void getAllShouldReturnAllCapturedOutput() {
System.out.println("Hello World");
System.err.println("Hello Error");
assertThat(this.output.getAll()).contains("Hello World", "Hello Error");
}

@Test
public void getOutShouldOnlyReturnOutputCapturedFromSystemOut() {
System.out.println("Hello World");
System.err.println("Hello Error");
assertThat(this.output.getOut()).contains("Hello World");
assertThat(this.output.getOut()).doesNotContain("Hello Error");
}

@Test
public void getErrShouldOnlyReturnOutputCapturedFromSystemErr() {
System.out.println("Hello World");
System.err.println("Hello Error");
assertThat(this.output.getErr()).contains("Hello Error");
assertThat(this.output.getErr()).doesNotContain("Hello World");
}

@Test
public void captureShouldBeAssertable() {
System.out.println("Hello World");
Expand Down

0 comments on commit e1efdad

Please sign in to comment.