SYNOPSIS:

Spork is Tim Harper's implementation of test server (similar to the
script/spec_server that used to be provided by rspec-rails), except rather
than using the Rails constant unloading to reload your files, it forks a
copy of the server each time you run your tests. The result? Spork runs
more solid: it doesn't get corrupted over time, it can work with any
ruby framework, and it properly handles modules and any voodoo meta
programming you may have put in your app.

Spork runs on POSIX systems using fork. It also runs on windows by
pre-populating a pool of ready processes (referred to here as the
“magazine” strategy).

Supported Testing Frameworks

Rspec

Cucumber

Test::Unit (via 'gem install spork-testunit')

Supported Application Frameworks

Spork can work with any application framework, but needs work to prevent
application files from being eager loaded.

(If you don't specifiy a test framework, spork will find one and pick
it.)

Follow the instructions.

Finally, run spork. A spec DRb server will be running!

spork

Diagnostic mode

Initially, you may find that a few files don't reload automatically.
This is because they are being loaded during Spork startup. To identify
which project files are being pre-loaded, and why, run:

spork --diagnose | less
(or spork -d, for short)

It will output a lot of stuff. At the top you'll find a summary of all
project files loaded. Down below, the stack trace for each file (how it
got loaded). Spork hooks into Rails and does some magic (TM) to prevent
ApplicationController observers, etc from pre-loading. Similar hooks for
other ruby frameworks may come as support demands.

Some project changes will require a spork restart, and you shouldn't
expect them to not (IE: modifying your project gem dependencies or core
application config). Any file that is loaded during Spork start-up will be
cached until Spork is restarted. You can restart spork by sending a USR2
signal to the server process. This could be automated with a gem such as
Kicker (github.com/alloy/kicker). Since
a native hook is required for each operating system to efficiently watch
for filesystem changes, automatic restarting has not been built into Spork.