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.
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
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.
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.You should raise an Exception rather than
exit()
.You should raise an Exception instead of returning false for invalid inputs.
No random tests in Ruby
Ruby 3.0 should be enabled
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.
Oops. Sorry.
kata hint != kata suggestion
Approved
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.
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.
No proof, no issue.
Proof?
Ruby Tests are broken.
Loading more items...