Skip to content

palindrome-products: Rewrite tests to use hspec with fail-fast. #286

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

Merged
merged 1 commit into from
Sep 9, 2016
Merged

palindrome-products: Rewrite tests to use hspec with fail-fast. #286

merged 1 commit into from
Sep 9, 2016

Conversation

rbasso
Copy link
Contributor

@rbasso rbasso commented Sep 7, 2016

  • Rewrite tests to use hspec.
  • Add HINTS.md.
  • Move old hints to HINTS.md.
  • Update the stub solution.

We took the opportunity to use this PR as a first experiment with HINTS.md in the Haskell track.

Related to #211.

@petertseng
Copy link
Member

Seems good.

Don't let this hold up merging, but a question!

Regarding the experiment to use HINTS.md: What result do you think you will use to decide whether to apply it to other exercises?

cases = [ ("palindromes from single digit factors", 1, 9, 1, [( 1, 1)], 9, [(1, 9), (3, 3)])
, ("palindromes from double digit factors", 10, 99, 121, [( 11, 11)], 9009, [( 91, 99)])
, ("palindromes from triple digit factors", 100, 999, 10201, [( 101, 101)], 906609, [( 913, 993)])
, ("palindrome from four digit factors" , 1000, 9999, 1002001, [( 1001, 1001)], 99000099, [( 9901, 9999)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simgular versus plural, maybe they should all be the same?

Copy link
Contributor Author

@rbasso rbasso Sep 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Fixed! 😄

- Rewrite tests to use `hspec`.
- Add `HINTS.md`.
- Move old hints to `HINTS.md`.
- Update the stub solution.
@rbasso
Copy link
Contributor Author

rbasso commented Sep 9, 2016

Regarding the experiment to use HINTS.md: What result do you think you will use to decide whether to apply it to other exercises?

Right now we have hints as comments in the test suites and in the stub solutions.

The comments in the stub solutions proved to be a tragedy, because most of the users just leave the hints in the submitted code.

The comments in the test suite are not that bad, but I think that the users should get feedback primarily running the test suite, not inspecting it.

If the hints file works as expected, I think it would be probably a good idea to do the same for all exercises. But first I would like to check if it is correctly inserted in the README.md and if it doesn't have unexpected effects.

What do you think about it?
Any other track is using it?

@rbasso rbasso merged commit 0f2efbc into exercism:master Sep 9, 2016
@rbasso rbasso deleted the hspec-palindrome-products branch September 9, 2016 00:12
@petertseng
Copy link
Member

I wish I could just search for https://github.com/search/advanced?l=&q=org%3Aexercism++path%3AHINTS.md&ref=advsearch&type=Code&utf8=%E2%9C%93 but I was not able to get this to work. Maybe someone else will have better luck.

Oh well, at least I know that xrust has https://github.com/exercism/xrust/blob/master/exercises/space-age/HINTS.md

@NobbZ
Copy link
Member

NobbZ commented Sep 9, 2016

Also I do know about xelixir, which does something similar: https://github.com/exercism/xelixir/tree/master/exercises/zipper/hints

There it is a subfolder in the exercise, containing a README.md as well as three files hint_i.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants