Clone this wiki locally
Running Spork on Windows machines is supported by creating new processes in advance instead of forking, which isn’t supported in Windows.It currently requires the installation of the win32-process gem, which is used to create a new process for each slave the magazine run strategy creates upon startup. These slaves are stored in a distributed Ruby (DRb) Rinda tuplespace. The slave processes (two for now) are created when the run strategy is started. When RSpec or Cucumber runs a test, a slave is taken from the tuplespace, is used to run the tests, and the process is killed. A replacement process is created and added to the tuplespace. This allows tests to be run without interruption about every 10 seconds.
This will not currently work with JRuby, since the win32-process gem is a native gem. Another way of starting a new process may allow JRuby to join the party.
gem install spork
This should install the win32-process gem automatically for you. If not, then
gem install win32-process.
- Set up your project to use Spork by bootstrapping and editing helper files (see directions)
- Start up Spork server in a console window:
spork rspec(Rspec) or
- Run tests in another console window:
spec spec --drb(Rspec) or
Note: Do not include the
--drboption in the
spec.optsfile for Rspec, just add
--drbto the command line.
- (A bug causes an unwanted test to be run while a slave is being built).
- Add the
--drboption to the
spec/spec.opts.netbeansfile (I copied it from the
- Do not include
- Close the Spork console by using CTRL+BREAK. This should also kill the slave processes.
- you may want to check for stray ruby processes.