thoughtbot / vim-rspec

Run Rspec specs from Vim
https://robots.thoughtbot.com
MIT License
656 stars 108 forks source link

Is it possible to send pkill process before running test ? #110

Closed benoittgt closed 8 years ago

benoittgt commented 8 years ago

Hello

I would like to know if it's possible to send a !pkill 'myprocess' before running rspec_command. I'm using rerun and test loop at every files changes. When I want to run different test I have to jump to iterm, ctrl+c and then I can restart the test from macvim.

For the moment I only have

" Rspec.vim run command
let g:rspec_command = "clear && rerun --dir app,spec,config bin/rspec -b -p "**/*.{rb,js,jbuilder,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md}" ' {spec}"
let g:rspec_runner = "os_x_iterm"

It seems I have to stop the rerun process. If I do :!pkill -f rerun it's kill properly the process. But if I do let g:rspec_command = "!pkill -f rerun && clear && rbr {spec}" I get

Error detected while processing function RunCurrentSpecFile[4]..<SNR>40_RunSpecs:
line    3:
E34: No previous command      

Thanks in advance.

Benoit

gylaz commented 8 years ago

Try: let g:rspec_command = "pkill -f rerun && clear && rbr {spec}" without the !.

benoittgt commented 8 years ago

Thanks @gylaz

The command is sent to the iterm window but not executed.

capture d ecran 2016-02-01 a 19 49 56

I think it's more related to rerun than vim-rspec. I close it for now and will dig into stop properly rerun from vim.