Spork guard allows to automatically & intelligently start/reload your RSpec/Cucumber Spork server(s).
Compatible with Spork 0.8.4 & 0.9.0.rc2
Tested on Ruby 1.8.6, 1.8.7 & 1.9.2.
Please be sure to have Guard installed before continue.
Install the gem:
gem install guard-spork
Add it to your Gemfile (inside test group):
Add guard definition to your Guardfile with:
guard init spork
Please read Guard usage doc
Spork guard can be really be adapated to all kind of projects. Please read Guard doc for more info about Guardfile DSL.
!!! IMPORTANT: place Spork guard before rspec/cucumber guards !!!
guard 'spork' do watch('^config/application.rb$') watch('^config/environment.rb$') watch('^config/environments/.*\.rb$') watch('^config/initializers/.*\.rb$') watch('^spec/spec_helper.rb') end
Spork guard automatically detect RSpec/Cucumber/Bundler presence but you can disable any of them with the corresponding options:
guard 'spork', :cucumber => false, :bundler => false do ... end
:wait => 30 # Seconds to wait server launch, default 20 :cucumber => false :rspec => false :bundler => false # don't use "bundle exec" :rspec_port => xxxx # default 8989 :cucumber_port => xxxx # default 8990
If you can start Spork manually but get the following error message when using Spork guard:
Starting Spork for RSpec ERROR: Could not start Spork for RSpec. Make sure you can use it manually first.
Try to increase the value of the :wait option before any further investigation.
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.