thoughtbot / vim-rspec

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

How to use with Projectionist #113

Open willian opened 8 years ago

willian commented 8 years ago

Hi, I'm trying to use Projectionist with vim-rspec, I already have it working with Dispatch but not with Projectionist.

I have this configuration on my .vimrc:

let g:rspec_command = 'w | Dispatch rspec {spec}'

nnoremap <Leader>t :call RunCurrentSpecFile()<CR>
nnoremap <Leader>s :call RunNearestSpec()<CR>
nnoremap <Leader>l :call RunLastSpec()<CR>
map <leader>t :call RunCurrentSpecFile()<cr>
map <leader>s :call RunNearestSpec()<cr>
map <leader>l :call RunLastSpec()<cr>
map <leader>a :call RunAllSpecs()<cr>

And I have this .projections.json file:

{
  "spec/*_spec.rb": {
    "dispatch": "docker-compose run artisan bundle exec rspec {file}"
  }
}

For some reason, when why run <leader>s it runs w | Dispatch rspec {spec} and not docker-compose run artisan bundle exec rspec {file}.

I'm wondering it I should ignore vim-rspec or use another command to execute the Projectionist configuration.

Does anybody have this same situation?

dgmstuart commented 7 years ago

I don't have a great understanding of how all this fits together, but perhaps it's something like projectionist isn't loaded in the expected way in the context that vim-rspec is running the command.

Here are a few ideas:

Does the | somehow confuse the issue? Does this work correctly if g:rspec_command = 'Dispatch rspec {spec}'?

Does it work in Terminal but not Gui (e.g. macvim) or vice versa?

Perhaps vim-rspec doesn't run in a buffer in the way that projectionist expects? https://github.com/tpope/vim-projectionist/issues/38