Skip to content

Commit

Permalink
tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 29, 2024
1 parent db09f6b commit ee2a50b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/test/java/hangman/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;

public final class MainTest {

Expand All @@ -29,7 +29,10 @@ public void failsAfterManyWrongAttempts() throws Exception {
);
final ByteArrayOutputStream output = new ByteArrayOutputStream();
new Main(input, output, 1).exec();
assertThat(output.toString(), containsString("You lost"));
MatcherAssert.assertThat(
output.toString(),
Matchers.containsString("You lost")
);
}

}

0 comments on commit ee2a50b

Please sign in to comment.