Why does my autospec keep looping?

After following all of the most up-to-date tutorials I could find, making sure I installed all of the latest gem releases, and just trying to be diligent overall, I couldn’t figure out why my autospec kept looping. In particular, it loops when there are Cucumber features being run ( by setting AUTOFEATURE=true before running autospec ). If you search around on Google, you will find a whole mess of articles with other people having the same issue, and all solutions seemed to come from this one article: http://www.ruby-forum.com/topic/183578 . After reading that, life was glourious for all, David Chelimsky to the rescue! From his life-saving post…

If you use Autotest with Ruby on Rails, be sure to gem install autotest-rails when you upgrade to ZenTest-4.1.0.

Without that gem, when you run the autospec command that ships with RSpec, Autotest won’t won’t have any way of knowing it’s in a Rails app and it will load up rspec’s autotest/rspec.rb instead of rspec-rails‘ autotest/rails_rspec.rb.

Absolutely brilliant! I run to my console, upgrade my gems … and it still loops! Determined not to give up, I did what any smart person would do, ask someone else.

After about a half-hour of frustration of wheel-spinning, Steve Walker and I were finally able to bang out a solution that just may work for you.

About half way down the github wiki for Cucumber, you will see a section titled “Other ways of running features” in which they advise you to put this in your cucumber.yml file

autotest-all: --require features --require lib --format progress features
autotest: --require features --require lib features
default: --format pretty
html: --format html --out features.html

This is a little out of date, most likely written before RSpec moved to autospec, and all hell breaks loose presumably because we are still configuring it to point to autotest.

In conclusion, drop in this …

autospec-all: --require features --require lib --format progress features
autospec: --require features --require lib features
default: --format pretty
html: --format html --out features.html

…and let me know if it fixes it.

Happy red/green/re-factor-ing!

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter

Comment | Trackback

Uncategorized

One Response to “Why does my autospec keep looping?”

  1. Steve Walker Says:

    January 17th, 2010 at 11:24 am

    I added the block to the git wiki page, hopefully that saves someone some time.

Leave a Reply