Hi guys, using vim-rspec, I’ve set let g:rspec_command = '!spring rspec {spec}' in my vimrc to use spring to run my tests. I also have some gem projects I work on, and I’d like to be able to use the plugin to run my tests there. Problem is, I obviously get errors saying Spring doesn’t exist.
I’d like to work out a way to tell if spring can be run in the current project, any ideas?
@geoffharcourt I think you might have misunderstood my question. I’m trying to figure out how I could check for spring. Maybe something like “if command -v spring isn’t an empty string, then use spring, otherwise use bundle exec”. It’s more a question of how you’d do it in vimscript/vimrc
I use a similar approach to @jferris but with direnv which is mentioned on the Spring README.
I’m confused about one thing though, I’ve been using GitHub - jonleighton/spring-commands-rspec on all my Rails 4 projects so far - what’s the difference between that and just running ‘spring binstub rspec’?
@jferris and others, do any of you have a problem with the spring RSpec binstub where if you add arguments to RSpec (like --profile) without specifying a directory that no tests get run? This isn’t a problem when you test from vim, but I find if I want to change options from the command line either with profiling or failing fast that I have to specify the path. It’s not clear to me from the binstub code why this is.
Great solution @jferris.
I’m having trouble with RVM + oh-my-zsh, because it changes PATH and the only solution I found to override is by running source ~/.zshrc.
When I open a new terminal, it loads:
I’m having trouble with vim-rspec and spring. In an app generated by suspenders, when running specs, bin/rspecgets called and spring gets started, no problem here, but when I change to other app, when running the specs does not starts spring, even though I have created the .git/safe folder and the :Rake command effectively uses spring.
The only solution I have right now is to use call Send_to_Tmux and explicitly use bin/rspec command.
I can’t figure out why is not working, any ideas?