Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    Try develop your test first before submitting. And refer to test docs at Codewars for syntax.

  • Custom User Avatar

    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

  • Custom User Avatar

    Did you change your code, or did the method mysteriously start working? I'm still getting NoMethodErrors for Array#any? and Array#all?

  • Custom User Avatar

    I think referring to Codewars Test Docs will help.

  • Custom User Avatar

    Finally done it.

  • Custom User Avatar

    I eventually got it to pass by simply doing raise "random text" if, followed by the error conditions.

  • Custom User Avatar

    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 an Exception. Hopefully this is more clear.

  • Custom User Avatar

    See my answer to @arieh.

  • Custom User Avatar

    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

  • Custom User Avatar

    Like others I have no idea how to get past the error cases. Please advise.