Skip to content

house: Fix tests to match x-common and add working stub solution. #348

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

house: Fix tests to match x-common and add working stub solution. #348

merged 1 commit into from
Sep 24, 2016

Conversation

rbasso
Copy link
Contributor

@rbasso rbasso commented Sep 23, 2016

  • Add HINTS.md explaining that this exercise is about refactoring.
  • Add a stub solution that passes the tests.
  • Remove extra newline in the tests to match description.md in x-common.
  • Patch example solution to pass the new tests.

Related to #301.

@petertseng
Copy link
Member

Oh, no line by line comparison this time? Is this OK? You know what would be really awesome? If hspec has a specialised shouldBe on strings so that it shows you a line-by-line diff if there is a mismatch... This is a lazy question, I haven't tested whether there is such a thing yet but I didn't find one after a few quick searches a few hours ago when discussing food-chain. I'll take another look in a few hours

- Try to reduce repetition to a minimum.
- Try to make the code readable.

Take your time.
Copy link
Member

@petertseng petertseng Sep 23, 2016

Choose a reason for hiding this comment

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

https://www.youtube.com/watch?v=RuqaVryDRd0&t=10

Ignore this comment of mine, it is not serious.

@rbasso
Copy link
Contributor Author

rbasso commented Sep 24, 2016

Oh, no line by line comparison this time? Is this OK?

I was not sure if I should use the same structure as food-chain, because of the uncommon error messages.

Well, I guess that is better than nothing. 😄

Fixing it now!

You know what would be really awesome? If hspec has a specialised shouldBe on strings so that it shows you a line-by-line diff if there is a mismatch...

I completely agree with you! That would be perfect!

I'll try to remember to take a look at that later, to see if we can write something like this.
But first I need to finish the infinite migration to hspec. Five to go! 😫

- Use lyrics from `x-common/exercises/house/description.md`.
- Tests all lines, one by one, and then the entire song.
- Add stub solution passing the tests.
- Patch example solution to work with the new tests.
@rbasso
Copy link
Contributor Author

rbasso commented Sep 24, 2016

Tests updated to use @petertseng's code to compare the lyrics, taken from food-chain.
Thanks again for that. 😄

@rbasso rbasso merged commit a279b4f into exercism:master Sep 24, 2016
@rbasso rbasso deleted the house-fix-tests-add-working-stub branch September 24, 2016 13:40
@rbasso
Copy link
Contributor Author

rbasso commented Sep 28, 2016

I haven't tested it yet, but I guess there is a shouldBe diff function, @petertseng !

You know what would be really awesome? If hspec has a specialised shouldBe on strings so that it shows you a line-by-line diff if there is a mismatch...

https://github.com/myfreeweb/hspec-expectations-pretty-diff#readme

It is already available in the current snapshot: https://www.stackage.org/nightly-2016-07-17/package/hspec-expectations-pretty-diff-0.7.2.4

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