exercism/exercism.io — pull request #980 by mjansen401 (2013-11-10 20:59:12+00:00)
Title: vary the test inputs, reorder tests to allow for smaller incremental changes

For the Ruby phone number assignment, I can make the entire test suite pass without implementing most of the functionality. Note the hardcoded return values for number, area_code, and to_s.

```` ruby
class PhoneNumber
attr_reader :phone_number_input

def initialize(phone_number_input)
@phone_number_input = sanitize(phone_number_input)
end

def number
if invalid_number?
"0000000000"
else
"1234567890"
end
end

def area_code
"123"
end

def to_s
"(123) 456-7890"
end

private

def sanitize(input)
input.gsub(/\D/,"")
end

def invalid_number?
phone_number_input.length < 10 ||
phone_number_input.length > 11 ||
(phone_number_input.length == 11 && phone_number_input[0] == "2")
end
end
````

I've made some changes to the test suite that will force the developer to return input other than "1234567890", "123", or "(123) 456-7890". I've also changed the order slightly to allow developers to make some smaller incremental changes to implement the algorithm.