Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Even adding tests for a single additional word would prevent this.
Instead of just:
You could add:
This alone would prevent much hardcoding. If you wanted to be more robust you could have an array of words and randomly select some (10 or so?) to run your three tests with. That way, each time the tests were run the kata solver would be presented with an entirely new set of words, completely eliminating the possibility for my variety of 'cheating'.
I'd like to think that rather than "cheating myself", I'm merely pointing out holes in your tests. If you'd like to prevent this kind of hardcoding in your kata's solutions, I suggest writing additional tests that expect properly formatted output from various greetings.