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!
Raison D’etre: Because I can!?
Acknowledgements: I used a bit of John W. Long’s posting to ruby-talk
from 2004-07-31 for the random bit although it looks a bit different
Changes: It is within a begin-rescue block now, since no parameters
are being passed it would sometimes fail and so will now try until it
finds a method that works without parameters.
methods = self.methods
random_method = methods[rand(methods.size)]
Perhaps this can be my entry into Ruby Q. of the Week’s as yet
unannounced ‘quiz’: ‘Stupidest Ruby Code Ever Competition?’ Perl has
competitions for obfuscation; how about we go for obtuseness?
Actually is there any good purpose to this?
P.S. I’ve already started thinking about the next version, or a similar
thing, which will automatically randomize methods on object creation or
method call using meta-classes…