06 November 2008

Trick for Netbeans 6.5 latest build and Autospec

On one hand, Autotest is a definitely great idea. Since I am using it with RSpec, I have saved a lot of times with it because it runs my tests automatically .Link

On the other hand, the Netbeans ruby IDE is getting better and better:

  • the auto-completion definitely rocks,
  • it's quite quick to open files and to Go to types (CTRL +O)
  • the Refactoring "Rename" is very handy (although cover you back with tests to make sure!)
  • Debugging rocks even if it's broken in 6.5 (see bug report)
RSpec is the test framework I use since 2007. I did embrace the whole BDD, "describe MyClass, it "should behave like ...." jargon because it feels so much natural than "assert_equals" ...

These 3 tools combined together should make me the most productive Agile Rails programmer but unfortunately if you live on the edge:
  • Netbeans-trunk-nightly-200811060201-ruby-linux.sh
  • RSpec 1.1.11
  • ZenTest 3.11.0
The right menu "Autotest" won't work ... It's probably the 4th or 5th time it happens to me so I am used to it ;-) Even if I find it ironic that such tools written by TDD people should work a bit better.

Fortunately, the solution is simple:
1. Update to the latest rspec-rails gem
[sudo] gem install rspec-rails
ruby script/generate rspec
It will generate a script/autospec file. Just open it, and run it with SHIT + F6 as a normal Ruby program. One caveat, why you press the "stop" button, it won't kill the autotest spawned by this script. You'll have to kill it manually ...

As a screencast is better than 1000 blog posts, I have made one to explain the netbeans software engineers and you what's the problem and how to solve it, just click here to watch it.

The only thing missing from Netbeans is official "git support" but I guess it should not take long as there is already an open source version http://nbgit.org

1 comment:

Steve said...

This is a really helpful how-to - thanks. BTW you have an unfortunate but v funny typo in this page...