-
-
Notifications
You must be signed in to change notification settings - Fork 195
connect: Rewrite test to use hspec with fail-fast. #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the Black/White -> Cross/Nought change since I kept having to look at the README to remember which was which when I was doing this problem. I agree that the long names are slightly more desirable than X/O (single letter are harder to search for, maybe there are other reasons!)
I usually would have liked to put the Black/White -> Cross/Nought in its own commit, but in this case it would mean changing lines in the old tests that then promptly get replaced, so this way of doing it is not unwarranted.
What would you like for resultFor
? winner
?
The fact that the board uses I'm not sure if I should have changed that here, because I removed all the references to colors in the exercise. Maybe it's a decision to be taken to Should we open an issue about it there?
You are right! I'll rewrite it, as a little punishment for my lack of discipline! 😄
I just had the feeling that I'm gonna change it in a separate commit. |
Seems good. You probably have to do it as I will be occupied for a few hours. |
Thanks for the review! Rewrote the PR in 3 separated commits, @petertseng. |
- Rewrite tests to use `hspec`. - Update tests to match `x-common`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
hspec
.x-common
.Color(Black,White)
toMark(Cross,Nought)
Related to #211.
Now all the tests match
x-common
almost exactly. The only difference is that I kept the expected value as an ADT, not a String containingX
orO
.Also, I had to change the ADT to have more meaningful names - how would anyone know that
X
wasBlack
- so I borrowed them from Tic-tac-toe's Wikipedia page. The alternative would be to useX
andO
, but I'm not sure if it is a good idea to have single letter data constructors.I can change the ADT if someone comes with better names.
Also, considering that we are breaking compatibility with old submissions, we could rename
resultFor
.Updated (3 commits)
hspec
with fail-fast.x-common
.Color(Black,White)
toMark(Cross,Nought)
.responseFor
towinner
.