1

I am using rails.vim plugin which is pretty awesome. However, I fail to see how could I test all the specs in one command. Right now I need to open a particular spec and do :Rake and that just tests the current opened spec. However, how could I test all the specs? Which command?

Thanks

Hommer Smith
  • 26,772
  • 56
  • 167
  • 296

1 Answers1

0

Have you tried pairing a rake task with a ViM leader mapping?

In your Rakefile, you could set up something like this:

desc 'Continuous integration task'
task :ci do
  ['rspec',
   'cucumber -f progress',
   'rake konacha:run'].each do |cmd|
    system("bundle exec #{cmd}")

    raise "#{cmd} failed!" unless $?.exitstatus == 0
  end
end

Then you can setup a leader command in ViM to execute your ci rake task:

nnoremap <leader>T :w\|:!bundle exec rake ci<CR>

Then when you execute <leader> T in normal mode, ViM will shell out and run bundle exec rake ci.

I use tmux, so I prefer the following leader mapping which runs the rake task in a bottom pane:

nnoremap <leader>T :w\|:silent !tmux send-keys -t bottom C-u 'bundle exec rake ci' C-m <CR>\|:redraw!<CR>

Devon
  • 118
  • 7