vim-rubytestでrspecのテストが走らなかったときの対応
vimから簡単にrubyのテストを実行出来るvim-rubytest
- ファイル単位
- テストケース単位
に対応しているからうれしい
かつ、
- testunit
- rspec
- cucumber
にも対応。テストファーストな開発のお友達です!
rspecで動かなかった
rspecに対応していないわけではない。
自分の環境でrspecをたまたま動かせなかったのだと思う。
:!echo 'rspec spec/models/hoge_spec.rb' && rspec spec/models/hoge_spec.rb rspec spec/models/hoge_spec.rb zsh:1: command not found: rspec
けどできないでいるのはいやなので、ちょっとだけいじる。
rspecじゃなくて、specならいるので、
if !exists("g:rubytest_cmd_spec") - let g:rubytest_cmd_spec = "rspec %p" + let g:rubytest_cmd_spec = "spec %p" endif if !exists("g:rubytest_cmd_example") - let g:rubytest_cmd_example = "rspec %p -l %c" + let g:rubytest_cmd_example = "spec %p -l %c" endif