Shoulda gets all sparkly

Tammer Saleh

The Shoulda testing plugin has been getting some love lately. Read on to see what we’ve done.

Stripped down Gem

The core components of Shoulda have been moved into their own gem. This pretty much just includes the context and should blocks, letting you do things like this:

context "a plain old ruby program" do
setup { ... }

should "be able to use the shoulda gem" do
  ...
end
...
end

outside of a rails application. This is something that a lot of people have been asking for, both on the Google group, and inside thoughtbot.

You can find the gem on rubyforge, and installation is as simple as sudo gem install shoulda.

You do not have to install the gem to use the plugin, as the plugin already has the core gem components inside it (thanks to the magic of piston).

Bugs beware

We’ve also opened a lighthouse account to keep track of known bugs and improvement requests. This is the first time we’ve used lighthouse for any of our projects, and we’re pretty interested in seeing how well it holds up.

So hit the lighthouse page and let us know of any bugs you’ve found.

Minor release - 3.0.5

Finally, we’ve strengthened some of the generated active record tests. should_have_many, should_have_one, and should_belong_to all now check the database schema to make sure your foreign keys are in place. We bundled that and a few small bug fixes into the latest release: 3.0.5. As you can tell from the major version of 3, Shoulda is now more mature than Rails.