Ruby/Mock is a MockObjects library for the Ruby language and RubyUnit? testing framework written by NatPryce. It uses closures to define expectations -- expectations are checked as tests run, rather than being post-analysed at the end of the test. The preconditions of a protocol can be abstracted into a reusable class that can then be parameterised by additional expectations.
There is interest in adopting it into the Ruby standard library some time in the future as part of standardising on a single unit testing framework.
Available from www.b13media.com/dev/ruby/mock.html