How to install the Shoulda rails testing framework

So you’ve decided to start using Shoulda instead of Rspec or Test::Unit in your latest rails project?  There’s one step you might not think to do, which strangely is absent in any of the Shoulda documentation.

After you `sudo gem install thoughtbot-shoulda` …

Don’t forget to put require ’shoulda’  at the top of whatever test classes you write, otherwise you’ll get “undefined method `should`” all over the place.  There, I saved you 4 hours.

2 Comments »

  1. Micah Said,

    January 7, 2009 @ 5:15 pm

    Just put it once in test_helper.rb That’s for universal includes like shoulda.

  2. Tammer Saleh Said,

    January 7, 2009 @ 8:38 pm

    You can also put that line in environments/test.rb (if this is a rails app).

RSS feed for comments on this post

Leave a Comment