Skip to content
Milhouse edited this page Sep 14, 2010 · 13 revisions

This is a forked repository. Have a look at timcharper’s spork wiki for more information.

It enables Windows machines to use Spork with RSpec and Cucumber to reduce start-up time for testing from about 20 seconds to 2 seconds. It 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. It will work as a replacement for the regular spork on Linux/Macs.

Using with test unit

Installation

  • gem install milhouse-spork (see fork at RubyGems.org)
  • gem install win32-process gem to use with Windows. This fork will work as normal on ’nixes.
  • The Spork binaries are updated with a reference to milhouse-spork when the gem is installed..

Use

To Run

  1. Set up your project to use Spork by bootstrapping and editing helper files (see Spork directions)
  2. Start up Spork server in a console window: spork rspec (Rspec) or spork cuc (Cucumber)
  3. Run tests in another console window: spec spec --drb (Rspec) or cucumber (Cucumber)
  • Note: Do not include the --drb option in the spec.opts file for Rspec
    • (A bug causes an unwanted test to be run while a slave is being built).
    • Just add --drb to the command line.

NetBeans

  • Add the --drb option to the spec/spec.opts.netbeans file (I copied it from the spec/spec.opts file).
  • Do not include --drb in the spec/spec.opts file.

When done

  • Close the Spork console by using CTRL+BREAK. This should also kill the slave processes.
    • you may want to check for stray ruby processes.

Thanks to Roger Pack (rdp) for his work in his Spork fork which got me started.

Clone this wiki locally