Closed davidmh closed 7 months ago
Hey @davidmh and thanks for raising! Yep that is something the plugin can't do. I'll see what other neotest adapters have done to solve this
I just tried with the python adapter and it seems to have the same issue, so maybe this should be upstreamed into neotest?
We define a NeotestAdapter.root
method in the adapter which detects the folder containing a Gemfile
or .rspec
file so we may be able to utilise that.
RSpec test
No response
Error messages
No lua errors, the error comes from running the rspec in the wrong directory.
Describe the bug
When running the tests in a monorepo, the
rspec
command will always run from the current working directory, instead of the one holding the Gemfile closest to the spec.Reproduce the bug
Failure
git clone https://github.com/davidmh/neotest-rspec-monorepo-example
cd neotest-rspec-monorepo-example
nvim -u minimal-init.lua service-a/spec/minimal_spec.rb
:Neotest run<cr>
Success
cd service-a/
nvim -u ../minimal-init.la spec/minimal_spec.rb
3:Neotest run<cr>
Final checks
minimal.lua
config file above and still get the issue:checkhealth treesitter