Ad
  • Custom User Avatar

    the lack of sample tests for Ruby has already been reported there

    here is a fork that adds them, along with random tests, Ruby 3.0 + RSpec, language-agnostic description

  • Custom User Avatar

    Codewars handles the "no example tests present" in a strange way, I've seen it on a couple of test suites when updating C# and JS kata. It looks like it's possible to have the example test snippets totally empty, but then strange things happen in the trainer and in the fork editor. Sometimes, the template is inserted, but it disappears when clicking RESET. Sometimes, the template is inserted and then shows up in the diff after publishing as added. So generally it's difficult to say if the template tests you see are there in the DB, and whether they will end up saved to the DB.

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    This is the current sample test code for ruby:

    # From Ruby 3.0, RSpec is used under the hood.
    # See https://rspec.info/
    # Defaults to the global `describe` for backwards compatibility, but `RSpec.desribe` works as well.
    describe "Example" do
      it "should return the sum" do
        expect(add(1, 1)).to eq(2)
        # The following is still supported, but new tests should now use them.
        # Test.assert_equals(add(1, 1), 2)
      end
    end
    

    Hitting the reset button empties the tests, but they were there upon opening it and they're there when pressing fork. Is it fully empty like the reset functionality suggests and is using a default?

  • Custom User Avatar

    copy your code then reset the trainer. You probably got an outdated version. If that's enough, don't forget to close the issue.

  • Custom User Avatar

    Tests still need to be updated to Ruby 3, but this specific issue is fixed.

  • Custom User Avatar

    Are you sure? This does not seem right. I created a solution which always returns "" and it passes 0 tests.

    EDIT: I think I can see the issue.

  • Custom User Avatar

    you think so?

  • Custom User Avatar

    Retired kata stay retired, and they cannot be brought back. Adding tests to a retired kata won't help it, but if you want you can still add them and ask for review on Discord if you want to train your authoring skills and get some practice before authoring your next challenge.

  • Custom User Avatar

    Retirement is permanent, but if you think you can improve it a lot to prevent retirement next time, you could simply create a new kata and copy your code across. However if the cause of retirement was people not finding it interesting enough, then simply adding random tests probably wont change that.

  • Custom User Avatar

    If you are interested with creating kata for Codewars, you can find following resources helpful:

    • Docs on authoring and articles linked from this stub,
    • My collection of authoring examples for ideas how to implement and organize tests,
    • Codewars Discord and its channels related to authoring.
  • Custom User Avatar

    Just a hunch, but beta is a ruthless process. If your kata isn't (nearly) perfect or interesting, or novel, from the start, chances are it will be downvoted. After so many downvotes, it's automatically retired. Without random tests, most power users will downvote immediately.

  • Custom User Avatar
  • Custom User Avatar

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

  • Loading more items...