Ad
  • Default User Avatar

    Look at the Notes section point 2, I clearly mention that there will be a clear winner or all have the same.

  • Default User Avatar

    How so? I tested using the assert_equals vs expect and the message is the same

  • Default User Avatar

    Also, the category of this kata is "bugfix", however, you're not fixing a bug, you're really implementing a new feature. Why don't you remove the default implementation and allow the practitioner to code up their own solution? Also, providing a code example as part of the test fixture would be nice.

  • Default User Avatar

    Thanks for the suggestions, I've modified the kata such that if a test fails, they receive a message stating what scenario their code failed on.

  • Default User Avatar

    I modified the kata such that it now generates a random name for each student (also making sure that the names are still unique). Thanks to the both of you for the advice.

  • Default User Avatar

    I understand, but I'm not sure what to put for the message. I can't quite say "Expected answer, but got wrongAnswer instead". If you have a suggestion I'm all ears, but otherwise, I'm not sure what I can do on my end.

  • Default User Avatar

    Yes, that would give you the names, but you would still have to figure out how much money each student had. It'd be different if the first student passed into the solution set was always the answer, but that's not true.

    What you're proposing is that I create a series of "random" unit tests to run on the solution. To me, that's against the spirit of Code Wars. If a solution is submitted, it should be ran against the exact same series of tests.

  • Default User Avatar

    Excellent point, I added a new line saying that if there is only a single student, then they have the most money.

  • Default User Avatar

    But how would the end user know that Eric or Andy were even names of students? Your solution pre-supposes that they know all student names.

  • Default User Avatar

    Thanks for the heads up about test fixture, I went ahead and solved that issue. I'm a bit confused on your comment about "randomness" of the tests, could explain a bit more?

  • Default User Avatar

    Your test cases are good, but your test cases don't cover all cases. For example what would the expected output be for this string "This is a weirdly spaced string" ?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution