# Maybe time to look at shoulda

Written by Piers Cawley on

So, because I'm sure that there's a better way of drying up my rails apps, I've been porting [Magritte](http://www.lukas-renggli.ch/smalltalk/magritte) to Ruby (given a good metadescription of your models and judicious application of the visitor and interpreter patterns, it's amazing what you can do). Now, Magritte comes with a pretty decent test suite in its Smalltalk box. However, that test suite makes serious use of inheritance. Several tests of the leaf classes in the Magritte description hierarchy define maybe three helper methods which parametrise the tests they inherit from their parent test suites.

It's all very clever (but in a good way), but it's a bugger to implement in Rspec. I've been reduced to writing a shared behaviours file with lots of blocks that look like:

shared_examples_for "MetaDesc::Description" do
...

Maybe it's time to go back to Test::Unit and maybe to try shoulda