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'm not sure why the intrepeter (Ruby 1.9.3 used @Codewars) sometimes behaves like that (it happens a few times). It thinks that the object is not instantiated/created (an array object in your example), thus send a NoMethodError exception.
In my case, I tweaked my code to create an Array object using different method.
Try develop your test first before submitting. And refer to test docs at Codewars for syntax.
NO FUN !! This kata is doesnt tell you exactly what cases need to be covered. I just dont think its well defined. It should give cases when it passes, when it fails ans what exceptions are suposed to be raised
Did you change your code, or did the method mysteriously start working? I'm still getting NoMethodErrors for Array#any? and Array#all?
I think referring to Codewars Test Docs will help.
Finally done it.
I eventually got it to pass by simply doing
raise "random text" if
, followed by the error conditions.Exception is the vague part because the test output just says
Test Failed Exception:Exception Exception:Exception
I was able to get it to pass with a specific Excpetion such as
InputException
. Also seing the solutions now, there are a few different options here but it can't just be raising anException
. Hopefully this is more clear.See my answer to @arieh.
Description is very vague, but basically author is expecting You to raise an exception if:
a) any char in the string is not a number
b) passed string is empty
Like others I have no idea how to get past the error cases. Please advise.