John Carter of Tait Electronics in New Zealand recently posted to the XP list his implementation of a Universal Unit Test in Ruby. Because the files section of the XP list is kind of hard to get to, I agreed to host it here on the site. Here’s the original post:
My TDD, DRY, YAGNI, yin/yang, closed loops and the Universal Unit Test post left many people saying, “Huh? Show me the code.”
http://groups.yahoo.com/group/extremeprogramming/message/110090
So to make sure the maximum number of brains explode, I have implemented it in Ruby and uploaded it to the files section of this group.
It is a “Warts and All”, blow by blow example of TDD developing a Universal Unit Test class in Ruby. Note that it includes a unit test for the universal unit test.
Limitations? Well, a couple are uncovered in the process of development and the obvious one that it applies only to transforming code.ie. I can’t, at the moment, think of a sane way of applying it to itself…
But I suspect that may be temporary. :-)