Skip to content

Beer song instance methods - #404

Merged
FridaTveit merged 3 commits into
exercism:masterfrom
vasouv:beerSong-instance-methods
Mar 29, 2017
Merged

FridaTveit merged 3 commits into
exercism:masterfrom
vasouv:beerSong-instance-methods

Conversation

@vasouv

@vasouv vasouv commented Mar 28, 2017

Copy link
Copy Markdown
Contributor

Oops, because I moved a couple of curly brackets, the diff is weird now. Should I fix in case it's confusing?

Also, question: why do we have ignore annotations if gradle runs all the tests anyway?

@FridaTveit

FridaTveit commented Mar 28, 2017 •

Copy link
Copy Markdown
Contributor

That's fine, I'm glad you moved the curly brackets, it looks better now :) When you've checked out the repo to develop, the gradle build will remove the @Ignores and run all the tests against the example code. But for people actually doing the tests (and fetching them with exercism fetch) the gradle test command won't do that :)

@vasouv

vasouv commented Mar 28, 2017

Copy link
Copy Markdown
Contributor Author

You're absolutely right! Now that you've mentioned it, I recall reading in the docs that the build runs all tests for devs, and ignores some of them for the users. I get it.

Thanks for the clarification :)

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great @vasouv! Only one small comment :)

assertEquals("99 bottles of beer on the wall, 99 bottles of beer.\n" +
"Take one down and pass it around, 98 bottles of beer on the wall.\n\n",
BeerSong.verse(99));
new BeerSong().verse(99));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you make a private BeerSong variable, then you can initialise it in a setup method and just do beerSong.verse(99) here :) That way you don't have to duplicate the initialisation in every test :)

@vasouv

vasouv commented Mar 28, 2017

Copy link
Copy Markdown
Contributor Author

Fixed. And to think my previous pull request was doing exactly that at the wordy exercise :P

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! Thanks @vasouv! :)

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