From: Joel VanderWerf Date: 2006-03-20T05:04:47+09:00 Subject: Re: Is Your Software Working A Little Too Predictably? thoran@thoran.com wrote: > Hello, > > Is Test::Unit always producing 0 errors? > > I have the solution! > > Stir in a packet of RandomMethod and "Hey Presto!", a return to the > delights of indeterminacy! Why stop there? $DEBUG=false $SAFE=3 # On the theory that if something goes wrong, you should just # try something else until you find something that works. module DuckDebugging def method_missing(meth, *args, &block) m = methods meth2 = m[rand(m.size)] result = send(meth2, *args, &block) rescue => ex p [self, meth2, args, ex] if $DEBUG retry else p [self, meth2, args] if $DEBUG result end end class Object include DuckDebugging end result = (now your program can be any batch of garbage just enter words at random and you will get something) p result -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407