It took longer than expected, but I finally took the time to work more on the testing script, I wrote about a while ago.
No more waiting for the Rails environment to start up, when you want to run a test quickly.. and you get pretty HTML output. Check out a screencast of it.
It’s still in a very early stage and I’m sure there still a lot of bugs. But anyways, you can give it a try and install it via rubygems:
The TextMate bundle for it is shipped as part of the gem. To install it simply do:
open `gem env gemdir`/gems/tddmate-0.1/textmate/TDDMate.tmbundle
Running tests faster via DRb
If you want to run tests with the client/server scripts, to avoid the startup time of the Rails environment, you gotta change your tests to load your controllers with require_dependency instead of require.
Example. Instead of having:
require File.dirname(__FILE__) + '/../test_helper'
require 'foo_controller'
# Re-raise errors caught by the controller.
class FooController; def rescue_action(e) raise e end; end
you need to change it to:
require File.dirname(__FILE__) + '/../test_helper'
require_dependency 'foo_controller'
# Re-raise errors caught by the controller.
class FooController; def rescue_action(e) raise e end; end