Ad
  • Default User Avatar
    it "should raise an error for string with illegal characters" do
      Test.expect_error(luck_check('6F43E8'))
    end 
    

    is obviously wrong - can't catch an exception that has already happened. that needs to be in a block. still strange that it doesn't complain when it doesn't raise when that's what it says it tests for. doesn't really matter though, unless this also happens for MRI 3.0.0

  • Default User Avatar

    For some reason, I was getting an error message that my Ruby code was not throwing an error when I pushed "Test" although my code had this line: raise ArgumentError, "string with illegal characters" if str.empty? || str.match?(/\D/). By commenting out this line, the test passed. However, it wouldn't pass when I pushed "Attempt". So, I removed the # to uncomment the error line before pushing "Attempt", and the code was accepted.

  • Custom User Avatar

    As long as the given input is not a string or any characters within it are not digits, you should raise an Exception. Currently, you are only checking whether the string is a single-spaced character and any of the characters in it is NaN, which is not feasible because strings can only store characters.

  • Custom User Avatar

    You should raise an Exception rather than exit().

  • Custom User Avatar

    You should raise an Exception instead of returning false for invalid inputs.

  • Custom User Avatar
    • No random tests in Ruby

    • Ruby 3.0 should be enabled

  • Custom User Avatar

    The overall idea is quite interesting and unique.
    I have to admit, though, that the requirement of an exception as a possible output
    seems to me unjust and unnecessary, especially in context of a FP oriented language.

  • Default User Avatar

    Oops. Sorry.

  • Custom User Avatar

    kata hint != kata suggestion

  • Custom User Avatar

    Approved

  • Custom User Avatar

    that is one way to handle issues

    But there is no issue presented. Issues like "tests are broken" or "it works on my PC" are simply useless, because you're giving no tangible information to track or fix.

    At least you mentioned the language, which is a start, but what next? Should I (or anyone else) go and debug the entire tests suite, trying to find a bug that probably doesn't exist? Keep in mind, I don't even know what I'm looking for, because there is no mention of a test that causes the failure, an error message that could help narrow it down, or... anything?

    There are a few issues already raised below, so you should check them first to see if it's already reported, or provide as much information as possible. The kata is 10 years old (originally published in Ruby), so I expect there to be some issues like poor feedback or lack of tests... but that has to be specified in issue report.

  • Default User Avatar

    It's not enough to just say something is broken; very often it is in fact the user's code, not the tests.

    So, the appropriate way to handle issues is to provide details, explaination, examples, or evidence of the problem, as can be seen in the post just before this thread.

  • Custom User Avatar

    No proof, no issue.

  • Custom User Avatar

    Proof?

  • Custom User Avatar

    Ruby Tests are broken.

  • Loading more items...