Skip to content

Add support for shoulda with minitest (idk if it works with rspec, I dont use it) #130

@merof-code

Description

@merof-code

Versions

explorer v0.9.2
Ruby 3.1.4
Rails 7.2 Minitest with rails

Problem

I see that when I added should gem and added a matcher, for example

class MyModelTest < ActiveSupport::TestCase
  context 'validations' do
    should validate_presence_of(:text)
  end
end

The json that gets passed around from the vscode:minitest:list does contain the methods, but they are listed as

{
  "description": "validations should validate that the length of :text is at least 3. ",
  "full_description": "validations should validate that the length of :text is at least 3. ",
  "file_path": ".//home/merof/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/shoulda-context-2.0.0/lib/shoulda/context/context.rb",
  "full_path": "/home/merof/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/shoulda-context-2.0.0/lib/shoulda/context/context.rb",
  "line_number": 62,
  "klass": "MyModelTest",
  "method": "test_: validations should validate that the length of :text is at least 3. ",
  "runnable": "MyModelTest",
  "id": ".//home/merof/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/shoulda-context-2.0.0/lib/shoulda/context/context.rb[62]"
},

Which makes them appear in a new category names . in the menu.
image

This is like a feature request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions