Search code examples
ruby-on-railsrspeccucumberguardspork

How do I ruby-debug in a spec or feature if I am using Guard and Spork?


I managed to get Cucumber, RSpec, Guard, and Spork play nicely with each other in a Rails 3 app, but now I am stuck with the above problem.

Currently I require 'spork/ext/ruby-debug' in the prefork block of spec_helper.rb but this works only if I run spork manually, without guard.


Solution

  • This worked for me: Replace your 'guard-spork' gem with this one:

    gem 'guard-spork', :git => 'https://github.com/irohiroki/guard-spork.git'
    

    More info on this blog post (in Japanese, but Google translate does a decent job).

    The author also created this handy Rails 3 example app to show how to set things up.

    Adding Guard to Spork makes it much more useful IMO. I may have to go back to using it now :)