Saturday, September 29th, 2007...2:10 pm

Textmate rSpec error


Jump to Comments

Just a short post to mention an issue with TextMate and the rSpec bundle that wasn’t so easy to figure out. There’s not much help on google about this, but I got lucky, so I thought I’d share it here so that if others encounter the same issue.

Sometimes, you might press your rSpec run shortcut, with the aim of getting the nicely formatted output, and see instead a blank textmate window with an error like:

/Users/username/Library/Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:18:in `run_files’: private method `split called for nil:NilClass (NoMethodError) from /tmp/temp_textmate.Hm7cJH:4

The very simple solution is that the Command-R run behaviour shortcut executes the selected files, not the currently open file. It’s quite similar to the Subversion bundle in that way. In order to resolve this, make sure you have the file selected in the file drawer. With no files selected, you will always get the above error. With some non-rspec files selected, you will have a different (longer) error.

This kind of sucks. This should default to the open file. Well, funnily enough, the TextMate rSpec bundle does include that, under a different shortcut. Press Command-D (for run behaviour description) and it will run the currently open file, rather than the selected directory, which Command-R defaults to.

That’s all for this post. I told you it would be short!

[?]
Share

Leave a Reply

Close
E-mail It