Upgrade to version 3 spec

This topic to discuss upgrade ruby test runner to spec version 3. I created PR for this feature, but it was closed :frowning:. I would like to discuss exactly this PR and the way how to better implement this.
My proposition is to add to test special comment with task_id value like this

def test_empty_strands
  ### task_id: 1
  # skip
  assert_equal 0, Hamming.compute('', '')
end

and final results.json should look like

{
  "version": 3,
  "message": null,
  "status": "pass",
  "tests": [
    {
      "name": "Empty strands",
      "status": "pass",
      "task_id": 1,
      "test_code": "assert_equal 0, Hamming.compute('', '')"
    }
  ]
}

If here are any ideas how to do it with better way – welcome to conversation.

Thanks for the PR. It got closed automatically rather than as a rejection of the work, but chatting here to agree the methodology is a good thing anyway :slight_smile:

I’d be happy with the approach you’ve taken, although I’d probably rather prefer a method like task(1) above the test, so

task(1)
def test_empty_strands
  # skip
  assert_equal 0, Hamming.compute('', '')
end

I feel like that reads a bit nicer. However, this might be hard to pull off for CLI users who don’t have our test runner that can inject stuff.

As a secondary option, I’d rather have the comment on the line before the test with just one hash. For example:

# task: 1
def test_empty_strands
  # skip
  assert_equal 0, Hamming.compute('', '')
end

That feels a bit more metadatay to me, and one # is inline with how other ruby special comments work (e.g. frozen_string_literal: true).

Thoughts?

Hello.
After a long pause (during which I lost and found a new job) I would like to return and finish this task.
@iHiD so, about your prepositions about how to mark task_id. In my opinion, better to do like a comment, outside or inside the method. It’s more easy to implement and does not add increased complexity.