Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Vim plugin to run specs for the current file.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc Search Gemfile.lock instead of Gemfile.

runspec.vim Build Status

A simple Vim plugin to run specs: if the current file ends in _spec.rb or _test.rb, run it; if not, guess where the associated spec file is and run that.

The plugin will attempt to automatically discover whether you are using RSpec or minitest/spec and use Bundler (and binstubs) if appropriate.


I recommend using Vundle and then you can install the plugin by simply adding the following line to your .vimrc:

Bundle 'mudge/runspec.vim'


By default, the plugin will bind to <Leader>t if it is not already mapped but you can manually map to <Plug>RunSpecRun like so:

map <Leader>r <Plug>RunSpecRun

You can override the automatic detection of the appropriate spec runner (e.g. rspec or ruby) by having an executable script/test that accepts a spec file as an argument.


In order to detect custom test runners accurately, the plugin requires that you are using Bundler and have a valid Gemfile.lock (so that it can work with Gemfiles that only specify gemspec).

If you are not using any gems (e.g. you are using only Ruby's built-in testing libraries) then you should not be affected as the plugin will default to using ruby as your test runner.

Something went wrong with that request. Please try again.