Railsgun.nvim is a lightweight Neovim plugin designed to quickly run RSpec tests or MiniTest in your Rails projects. Run individual tests or entire spec files instantly—without ever leaving Neovim.
- Run RSpec or MiniTest tests inline or the whole file with a single keybinding
- Configurable key mappings and settings
Using Lazy.nvim:
{
"ibramsterdam/railsgun.nvim",
opts = {}, -- Uses default settings
}
Railsgun allows you to configure options to customize behavior
{
"ibramsterdam/railsgun.nvim",
opts = {
win_type = "floating-window", -- Use "vsplit" for a vertical split
keys = {
run_spec = "<Leader>rs", -- Run test at cursor
run_all_specs = "<Leader>rss", -- Run entire spec file
toggle_terminal = "<Leader>st", -- Toggle terminal
}
}
}
<Leader>rs
→ Run RSpec test at the current line<Leader>rss
→ Run the entire spec file<Leader>st
→ Ability to toggle the terminal that is specified by the win_type
You can also run tests with the :Railsgun
command:
:Railsgun 15 " Runs test at line 15
:Railsgun " Runs the whole file
You can also toggle the terminal with :Railsgunterminal
Feel free to open issues or pull requests if you have improvements, bug fixes, or feature ideas!
This plugin is licensed under the MIT License.
Enjoy fast and efficient testing with Railsgun.nvim! 🚀