[hangman] Sync tests & Update solution to match canonical rules#3109
[hangman] Sync tests & Update solution to match canonical rules#3109thibault2705 wants to merge 6 commits intoexercism:mainfrom
Conversation
|
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
6910bc2 to
f207633
Compare
kahgoh
left a comment
There was a problem hiding this comment.
Hey @thibault2705, sorry this review is taking a while. I have noticed over on the forums, there is a proposal to replace this Hangman exercise with Save the Cow, which is going through review at the moment. I would like to suggest holding off on this one for a bit so that we can move to Save the Cow. I think the canonical data is largely the same, so I think you'd be able to most of this to the new exercise and rename things.
| public final List<Part> parts; | ||
| public final Status status; | ||
| public final Status state; | ||
| public final int remainingFailures; |
There was a problem hiding this comment.
Looking at the tests, I notice not all of these fields are checked. Do we need all of them? If not, consider removing the ones no longer needed.
| import static org.assertj.core.api.Assertions.assertThat; | ||
| import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertThrows; |
There was a problem hiding this comment.
We generally prefer using AssertJ over JUnit assertions (see issue #1803).
pull request
What has been done:
play(Observable<String> words, Observable<String> letters)toguess(String word, Observable<String> letters)maskedWord,state, andremainingFailuresto match canonical expectationsThis PR partially solves issues #2959.
Reviewer Resources:
Track Policies