triangle: Rewrite test do use hspec with fail-fast.#237
triangle: Rewrite test do use hspec with fail-fast.#237rbasso merged 1 commit intoexercism:hspec-fail-fastfrom rbasso:hspec-triangle
Conversation
|
Everything seems fine, 👍 I notice these are in a much more abbreviated style. I feel like some other test files could be written in this abbreviated style as well, e.g. roman-numerals where there should be no chance of confusion between input/expected |
|
This is not related to hunit->hspec, but exercism/problem-specifications#298 got merged so at some point soon we might rethink the (1, 2, 1, Illogical) case (triangle inequality implies it should be isosceles), but maybe some cross-track decision needs to be made there. We have flip-flopped on that decision before. |
|
Also you wrote "do use" in commit message rather than "to use" |
|
I'm still working on these PR, to make them more consistent with what was done on the previous ones exercises:
At first, I used tuples instead of To keep consistency and ease maintenance, I rewrote all the previous exercises to mimic the structure of the JSON file using a custom data type. This is certainly more verbose than using tuples, but is almost identical to the reference files and scales betters to more complex exercises. My original plan was to rewrite those remaining PRs to follow the same pattern. The decision is mostly about "homogeneity vs simplicity". I completely agree that I should have discussed that before, sorry. That was something that naturally evolved as I was porting the exercises to If you prefer I can use tuples on the open PRs and I'll merge new PRs to change the previous exercises in branch Edit: For exercises like |
|
I think ultimately there are problems that can use either a tuple or a record. We see that And there are problems that probably look better with a record. I'm sure you came across some examples. I am not sure if I can find one off the top of my head, maybe
This could be a good advantage. Currently the knowledge of how standard are the implementations is in your hands since you've done all of the hunit->hspec conversions to date. The corollary to that is you may know best which choices will cause less work for the remaining conversions. If there ever comes a time when it makes sense to put any tools for generating hspec cases from x-common json files into this repo, others may have a better idea of what choice to make. Currently I do not see the need to insist on any changes to any currently hspecced exercise, but we can discuss if you think you would like to change it after all. |
Considering that this would break the existing solutions, I prefer to wait a little until we see where the consensus goes. A json file would be great, but my focus now is on rewriting the tests to use |
Related to #211.