Closed thewatts closed 10 years ago
You could add ./bin
to your PATH
. Here's how Tim Pope suggests doing it. Then for projects that have spring
wrapped rspec
in their bin/
directory, it will use that. Otherwise, it'll find the next available rspec
in your PATH
.
@gylaz --- thanks for the quick response! I'll git it a shot!
hey @gylaz, just used Tim Pope's suggestion - and pulled the code directly from #52, and while it works great in terminal, when I'm in vim and run the command - it's not picking up Spring.
My direct command in my vimrc now: let g:rspec_command = '!bundle exec rspec {spec}'
Am I missing something?
If you have rspec
on your PATH as a binstub, you want just rspec
and not bundle exec rspec
. Using bundle exec
will force it to find the binary from the rspec-core gem and not from Spring.
Going to close this. @thewatts feel free to re-open if you're still having issues.
So to be clear, the "best of both worlds" @thewatts requested can be had by let g:rspec_command = 'rspec {spec}'
and adding ./bin
to one's PATH
- correct?
@mecampbellsoup from my testing just now, that is correct. Though I'm using RVM (I'm pretty sure @tpope is not), and I needed to do this to get my bin dir in the front of my path:
brew install direnv
eval $(direnv hook $0)
to the end of my ~/.zshrc
fileCreate a .envrc
file in the root of my project with the following content:
PATH_add bin
Currently in my Rails projects I use Spring for quick loading. Which, with the custom setting,
let g:rspec_command
, that makes it easy.Ex:
let g:rspec_command = '!bundle exec bin/rspec {spec}'
However, some of my projects don't use Rails or Spring, which - in that case I need to jump back into my
.vimrc
.Is there a way to set things up so that I can have the best of both worlds?
Side note: This plugin has changed my workflow completely (for the far better) - thank you for your hard work!