Autotest increases the speed at which tests run by running only the changed tests.
But I want to push it even further by using spork to preload the Rails environment, so that I will get even faster feedback.
Is this possible?
Autotest : https://github.com/grosser/autotest
I haven't tried it yet, but there's a section in chapter 3 of the RailsTutorial that tells some "hacks" to set up spork. The tutorial currently says:
The chapter goes on to tell how to set it up with autotest. One thing to know is that you'll need
in your .rspec file.
If you use Ruby 1.9 and want to use spork and autotest together with Test::Unit (actually MiniTest) try this:
Gemfile:
.autotest:
(Note: Instructions says
bin/testdrb
, but I changed it totestdrb
to make it work for me.)In a terminal:
Edit
test/test_helper.rb
and follow instructions.After the above setup is done once, you can start the test server:
Finally start autotest in another terminal:
And (hopefully) enjoy really fast autotesting with MiniTest.
ARTICLE1 mikbe has you covered! I would attempt to rephrase it here, but the post does such a great job.
If you happen to be on OSX, there are also instructions to utilize Growl for tray notifications.
ARTICLE2 Ruby Inside also has a walkthrough for Rails 3 and RSpec 2.