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.
I am dissapointed in the number of solutions I see that are object based.
Disclaimer: I am a Rubyist, and as such I have only been practicing Ruby kata.
The entire point of training with kata is to develop positive habits with practice. If you are developing in an OO language, the positive habits you want to develop are Object Oriented in nature. If the code you produce while training with kata is not Object Oriented, then you are not developing habits that will help your Object Oriented programming!
In my opinion, Ruby is one of the greatest OO languages ever produced. We should be using the power of Objects that it provides!
This comment is hidden because it contains spoiler information about the solution
I thought about this, but I decided this kata could be performed without seriously impacting any core Classes.
It's not very idiomatic Ruby to force a regexp match to return a boolean (true/false).
In Ruby, the Regexp class's #=~ and #match methods return nil (false-y in Ruby) if no match was found, or a Fixnum (truth-y in Ruby) which is the first match's index position in the string if a match was detected.
Therefore, in my opinion, the test case should have read:
Test.expect(validPhoneNumber("(123) 456-7890"), 'expected "(123) 456-7890" to be valid' )