• Custom User Avatar

    Sorry, did not notice that you already prepared a fix so I fixed it also.

  • Custom User Avatar

    Awesome job, thanks trashy_incel!

  • Custom User Avatar

    First comment, I solved.

  • Custom User Avatar

    added sample and random tests to Ruby. currently only Java is missing random tests and this is reported there

  • Custom User Avatar

    done

  • Custom User Avatar

    this would be contrary to the Codewars policy that advises against trivial input validation

  • Custom User Avatar

    this would be contrary to the Codewars policy that advises against trivial input validation

  • Custom User Avatar

    added

  • 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

    holy sh...

  • 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

    Ruby: The test is broken. It is only possible to complete the kata when submitting without prior testing. The test seems to be unrelated to the kata.

    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

    should return the sum

    #<NoMethodError: undefined method add' for main:Object> main.rb:11:in block (2 levels) in '
    /runner/frameworks/ruby/cw-2.rb:180:in wrap_error' /runner/frameworks/ruby/cw-2.rb:72:in it'
    /runner/frameworks/ruby/cw-2.rb:206:in it' main.rb:10:in block in '
    /runner/frameworks/ruby/cw-2.rb:55:in block in describe' /runner/frameworks/ruby/cw-2.rb:46:in measure'
    /runner/frameworks/ruby/cw-2.rb:51:in describe' /runner/frameworks/ruby/cw-2.rb:202:in describe'
    main.rb:9:in `'

  • Loading more items...