A simple Vim plugin to execute RSpec through :make command.
Run rspec
inside Vim and ouptut of failing specs into quickfix window (:cwindow). Also be able to run the spec/context/describe where the cursor is.
To run the nearest spec/context/describe where the cursor is.
:MRSpecLine
To run specs for the current spec file.
:MRSpecFile
To run all specs.
:MRSpecAll
To re-execute the last spec location (line, file or all). It can be called out of a spec file. Useful when you fix a failing spec in production source file.
:MRSpec
If you think the commands too long or would like another commands, just put something like below into your ~/.vimrc
file.
command RL call mrspec#RunLine()
command RF call mrspec#RunFile()
command RA call mrspec#RunAll()
command R call mrspec#Run()
Now you can simple execute :RL
, :RF
, RA
and :R
to run each function, respectively.
You may install as you prefer. I like Vundle.
Put it into your Vundle configuration:
Bundle "pablobender/vim-mrspec.git"
If you use pathogen as plugin manager, just unpack or clone the repository in your ~/.vim/bundle
dir (creating a subfoler, eg: ~/.vim/bundle/vim-mrspec
).
But if you don't use a plugin manager, you can download the source code and put it into your ~/.vim
. Make sure to put the contents of vim-mrspec
folder into your ~/.vim
, not create a new vim-mrspec
under it.
MRSpec is a pure vimscript plugin, but only make sense if you are working on ruby/rspec project. So you need be able to run rspec
on your terminal for your project.
MIT