github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

timcharper / spork

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 201
    • 17
  • Source
  • Commits
  • Network (17)
  • Issues (13)
  • Downloads (27)
  • Wiki (4)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (4)
    • master ✓
    • msg
    • next
    • socket_pair
  • Tags (27)
    • 0.7.5
    • 0.7.3
    • 0.7.2
    • 0.7.1
    • 0.7.0
    • 0.6.3
    • 0.6.2
    • 0.6.1
    • 0.6.0
    • 0.5.11
    • 0.5.9
    • 0.5.8
    • 0.5.7
    • 0.5.6
    • 0.5.5
    • 0.5.4
    • 0.5.3
    • 0.5.2
    • 0.5.1
    • 0.5.0
    • 0.4.3
    • 0.4.2
    • 0.4.1
    • 0.4.0
    • 0.3.0
    • 0.2
    • 0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state. — Read more

  cancel

spork.rubyforge.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

prevents Spork from bailing if the child process dies unexpectedly 
timcharper (author)
Tue Feb 02 10:45:43 -0800 2010
commit  3e93f51c7331c38569b4a90d13b213582805d852
tree    887ce46d2cd650b54577c7c264b0f1db34de625c
parent  cb185bcba7aabb3f3de7729d3d12a3288954d910
spork /
name age
history
message
file .gitignore Wed Jun 03 23:08:03 -0700 2009 ignore tmp directory [timcharper]
file History.txt Fri Dec 04 13:39:52 -0800 2009 0.7.4 release [timcharper]
file MIT-LICENSE Sat May 30 00:22:53 -0700 2009 added license information [timcharper]
file README.rdoc Tue Dec 08 12:30:20 -0800 2009 Update obsolete README [marcandre]
file Rakefile Fri Dec 04 13:34:21 -0800 2009 output tested rails versions to TESTED_RAILS_VE... [timcharper]
file TESTED_RAILS_VERSIONS.txt Fri Dec 04 13:34:21 -0800 2009 output tested rails versions to TESTED_RAILS_VE... [timcharper]
file VERSION.yml Mon Dec 28 00:06:02 -0800 2009 bumped to 0.7.5 [timcharper]
directory assets/ Mon Jun 08 11:38:44 -0700 2009 cleaned up features to make them more suitable ... [timcharper]
directory bin/ Sun Oct 11 16:00:42 -0700 2009 Upgraded gem dependencies, Removed require 'tes... [aslakhellesoy]
directory features/ Fri Dec 04 13:34:21 -0800 2009 Webrat is not needed to test cucumber integrati... [timcharper]
file geminstaller.yml Wed Nov 04 08:57:27 -0800 2009 include ruby-debug in list of gems needed to ru... [timcharper]
directory lib/ Tue Feb 02 10:45:43 -0800 2010 prevents Spork from bailing if the child proces... [timcharper]
directory spec/ Fri Dec 04 13:34:21 -0800 2009 fix brittle spec that failed if other framework... [timcharper]
file spork.gemspec Mon Dec 28 00:06:02 -0800 2009 bumped to 0.7.5 [timcharper]
README.rdoc

Spork

  • Repository: github.com/timcharper/spork
  • Issues: github.com/timcharper/spork/issues
  • Changes: github.com/timcharper/spork/blob/master/History.txt
  • Mailing list: groups.google.com/group/sporkgem
  • Wiki: wiki.github.com/timcharper/spork

SYNOPSIS:

Spork is Tim Harper’s implementation of test server (similar to the script/spec_server 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, and it properly handles modules and any voo-doo meta programming you may have put in your app.

Because Spork uses Kernel.fork, it only works on POSIX systems. This means Windows users are not invited to this party. Sorry :(

Supported Testing Frameworks

  • Rspec
  • Cucumber

And more to come! Vote for your favorite at github.com/timcharper/spork/issues

Supported Application Frameworks

Actually, Spork ~can~ work with any application framework. But, it ships with hooks and helpers to help make the experience much more "out of the box"

  • Rails

More can be added! Vote for your favorite at github.com/timcharper/spork/issues

INSTALL:

  [sudo] gem install spork

alternatively:

  git clone git://github.com/timcharper/spork.git
  cd spork
  gem build spork.gemspec
  sudo gem install spork.gemspec

Usage

From a terminal, change to your project directory.

Then, bootstrap your spec/spec_helper.rb file.

  spork --bootstrap

Next, edit spec/spec_helper.rb and follow the instructions that were put at the top.

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
  (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.

Running specs over Spork

RSpec

To get the TextMate RSpec bundle to use spork, go to config->advanced->shell variables, and add:

  TM_RSPEC_OPTS=--drb.

To run from the command line, use:

  spec --drb spec/lib/my_spec.rb

Or, you could add the following flag to your +spec.opts+ file.

  --drb

Cucumber

Cucumber has DRb support (see wiki.github.com/aslakhellesoy/cucumber/spork-and-drb )

  cucumber --drb

Use this as a guideline when "Sporking" your features/support/env.rb file

  http://gist.github.com/123370

Some potential issues and ways to overcome them:

See wiki.github.com/timcharper/spork/troubleshooting

Kudos to

  • Ben Mabey - help with documentation, testing, suggestions, patches, and bringing Cucumber support.
  • David Chelimsky - for the fine RSpec testing framework, and the original rspec-rails spec_server implementation, which Spork has built upon.
  • Lead Media Partners - just for being an awesome place to work.

Spork © 2009 Tim Harper, released under the MIT license

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server