Skip to content

crypto-square: Rewrite tests to use hspec with fail-fast. #249

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
Aug 7, 2016
Merged

crypto-square: Rewrite tests to use hspec with fail-fast. #249

merged 1 commit into from
Aug 7, 2016

Conversation

rbasso
Copy link
Contributor

@rbasso rbasso commented Aug 2, 2016

  • Rewrite tests to use hspec.
  • Remove old tests.
  • Add tests to match x-common.
  • Remove function squareSize from the test suite.
  • Remove function squareSize from the stub solution.
  • Remove function squareSize from example's export list.

Related to #211.

- Rewrite tests to use hspec.
- Remove old tests.
- Add tests to match `x-common`.
- Remove function `squareSize` from the test suite.
- Remove function `squareSize` from the stub solution.
- Remove function `squareSize` from example's export list.
normalizeCiphertext "This is fun!"
`shouldBe` "tsf hiu isn"

{- In this track the encoded text chunks are not padded with spaces.
Copy link
Member

Choose a reason for hiding this comment

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

do you think they should be?

I realize it would probably make the example implementation a bit more complex

To make it clear, I don't care enough to insist on one way or the other

Copy link
Member

Choose a reason for hiding this comment

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

Should we instead keep the old test that expects imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau?

Copy link
Contributor Author

@rbasso rbasso Aug 6, 2016

Choose a reason for hiding this comment

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

I think that this exercise is not very idiomatic and deserves a major rewrite, with better functions name and, maybe, using lists of strings. But for now, I am just trying to document the differences between the track and x-common.

I'm against that last test. The multiple spaces between the words make sense only if we look at the string as a matrix - and this is probably the reason why there is space padding in the exercise - but in Haskell we would never represent a matrix as a single string.

What do you think? Should we enforce non-padding (old test), padding (json) or accept both (PR)?

Copy link
Member

Choose a reason for hiding this comment

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

Given that you have plans pending, I'm fine with leaving this commented as it already is. The student can uncomment it if truly desired, and there is a test for the perfect square case above. As long as there is a note in either #194 or a new issue describing the change planned!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue opened! Thanks again, @petertseng!

I know it is probably boring to review so many similar Hspec PRs, but we almost there. 😄

As long as there is a note in either #194 or a new issue describing the change planned!

Copy link
Member

Choose a reason for hiding this comment

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

I know it is probably boring to review so many similar Hspec PRs, but we almost there.

I think to be commended more is your persistence in doing all of them, actually!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a lot of fun rewriting the first 10 exercises... 😁

@rbasso rbasso merged commit 38fad05 into exercism:hspec-fail-fast Aug 7, 2016
@rbasso rbasso deleted the hspec-crypto-square branch August 7, 2016 05:52
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.

2 participants