Serge Vinogradoff
Serge Vinogradoff

Reputation: 2272

How to run current RSpec test in VIM + Rails.vim + Ubuntu?

It says everywhere:

But when I'm at my _spec.rb file, and type :Rake - it just closes VIM, does nothing and outputs Please hit Enter to continue. It's not running current test.

Anyone knows?

Upvotes: 1

Views: 810

Answers (2)

Kaka Ruto
Kaka Ruto

Reputation: 5125

You might want to give vim-test a try?

It's a vim wrapper for running tests on different granularities.

To run the nearest spec for example, run :TestNearest and enter.

The readme lists the following mappings for quicker test running:

nmap <silent> t<C-n> :TestNearest<CR>
nmap <silent> t<C-f> :TestFile<CR>
nmap <silent> t<C-s> :TestSuite<CR>
nmap <silent> t<C-l> :TestLast<CR>
nmap <silent> t<C-g> :TestVisit<CR>

NB: Vim-test supports major languages so running your tests in different languages won't change.

Upvotes: 0

Dhruva Sagar
Dhruva Sagar

Reputation: 7307

Try :.Rake or :%Rake to run current file / current test.

Upvotes: 1

Related Questions