1

It says everywhere:

  • Interface to rake. Use :Rake to run the current test, spec, or feature. Use :.Rake to do a focused run of just the method, example, or scenario on the current line. :Rake can also run arbitrary migrations, load individual fixtures, and more. :help rails-rake

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?

Serge Vinogradoff
  • 2,262
  • 4
  • 26
  • 42

2 Answers2

1

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

Dhruva Sagar
  • 7,089
  • 1
  • 25
  • 34
0

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.

Kaka Ruto
  • 4,581
  • 1
  • 31
  • 39