Closed merof-code closed 10 months ago
Hi @merof-code, unfortunately, I don't think we could do much on the shoulda-matchers
side to help with that. It's probably necessary to revisit how the vs code extension defines the file_path of the specs/matchers defined outside the app code. I'm closing this issue, but please feel free to re-open it if we can do something to help you with that.
I like using
ruby-test-explorer
andminitest
: https://github.com/connorshea/vscode-ruby-test-adapter https://marketplace.visualstudio.com/items?itemName=connorshea.vscode-ruby-test-adapterAnd currently it does not work with
shoulda
tests, at all. I want to use shoulda in my project, so I want to fix that.This extension works by putting together all the tests info here def build_list. And using file path and line number for opening the test, displaying in UI and running individually.
It does so by extending minitest and collecting all the
Minitest::Runnable.runnables.map do |runnable|
=>runnable_methods
Here is the important part (part of it:) )
JSON that is passed to the extension
Note:
line_nuber
is used to run the test separately (some fields omitted)This json works for the extension
This is a json that is returned with shoulda
And this all can be run by entire dir, file or by file and line number. The last one is interesting for this case. Because we can't run the test by line because it does not exist there, it is in the shoulda gem
So, the question is, how can this be done with shoulda?
PS sorry for being jumbled up a bit, accidentally submitted with ctrl+enter before finished refining.