Set up rspec on Rails
I have described the steps to install and configure rspec, the Autotest module from ZenTest and a notifier for Ubuntu.
Make sure you have the latest rubygems (0.9.4)
sudo gem update --systemInstalling rspec
At the time of this writing - 5th of June 2007 - latest version of rspec is 1.0.4, and we'll install it in the vendor/plugins:cd <your project home>Check out http://rspec.rubyforge.org/ for updates (I could not find a RSS) but I guess Aslak will be updates on his blog.
ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec
ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rail
Warning: if you had installed rspec before, run a "gem list" to check if you have a web_spec rogue gem, you must delete it before carrying on, more details in Zenspider's blog.
Installing and configuring Zentest
Latest version of ZenTest is 3.6.0, runsudo gem install ZenTestThankfully due to the extensible nature of autotest, we'll be able to set up a notifier for ubuntu by adding the following to your
<Rails project root>/.autotest
file:
|
sudo apt-get install libnotify-bin
Finally, from the Rails project’s root, type:
autotest
Pressing Control-C
twice in quick succession will exit Autotest back to the shell prompt.
Integration with netbeans
As far as I am concerned, netbeans ruby-ide is the first IDE to integrate autotest. Select your project root in the Projects windows, right click and then "Auto Test". This will open an output window and run Autotest. This is very cool, check out the screenshot:
1 comment:
For ZenTest 3.9.2, it seems that "at.files_to_test.size" returns the number of files that failed, not the number of tests that failed. The following snippet seems to work for me.
notify ERROR_STOCK_ICON, "Tests failed", "#{at.files_to_test.values.flatten.size} tests in #{at.files_to_test.size} files failed"
Post a Comment