The only thing I haven’t been able to do with Vim that I was able to do with TextMate is run a focused test or context when using Shoulda.
:Rake
runs the current file (which still works fine)
The help docs on :Rake say this:
Additionally, when :Rake is given a line number (e.g., :.Rake), the following
additional tasks can be invoked:
File Task ~
unit test test:units TEST=... TESTOPTS=-n...
...
However when I run something like :35Rake, with the line number being the line with either:
should "validate presence of something" do
or some statement within the test, it still runs all of the tests in the file. Has anyone else figured out a way to get it to work?
Thanks so much for any help/advise guys, I’ve looked everywhere I could for the past few days and haven’t come up with anything :-/
EDIT: For what it’s worth, I’m using MacVim 7.3, rails.vim 4.3, OSX 10.6, ruby 1.8.7, and rails 2.3.5
EDIT #2: I’ve emailed Thoughtbot (developers of Shoulda, some of whom use Vim) and checked out the Shoulda Google group (and all the people linking to their vim scripts had removed the scripts), and I’ve come to the conclusion that I should just write my own Vim script. I’ve checked out the code for the most popular Shoulda bundle for TextMate and took note (noticed some bugs, too). If I end up writing a script for it, I’ll post the link here.
Have you tried the Rubytest plugin
http://www.vim.org/scripts/script.php?script_id=2612
This works with shoulda and can run a single test