This plugin provides an RSpec adapter for the Neotest framework.
Install the plugin using packer:
use({
'nvim-neotest/neotest',
requires = {
...,
'olimorris/neotest-rspec',
},
config = function()
require('neotest').setup({
...,
adapters = {
require('neotest-rspec'),
}
})
end
})
The plugin may be configured as below:
adapters = {
require('neotest-rspec')({
rspec_cmd = function()
return vim.tbl_flatten({
"bundle",
"exec",
"rspec",
})
end
}),
}
This is not yet directly support by neotest, but you can accomplish this using a shell script as your rspec command. See this comment for an example.
NOTE: All usages of require('neotest').run.run
can be mapped to a command in your config (this is not included and should be done by yourself).
To test a single test, hover over the test and run require('neotest').run.run()
To test a file run require('neotest').run.run(vim.fn.expand('%'))
To test a directory run require('neotest').run.run("path/to/directory")
To test the full test suite run require('neotest').run.run("path/to/root_project")
e.g. require('neotest').run.run(vim.fn.getcwd())
, presuming that vim's directory is the same as the project root.
This project is maintained by the Neovim Ruby community. Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example spec that can be tested.
To trigger the tests for the adapter, run:
./scripts/test
A special thanks to the following contributers: