I use Test::Unit a lot, and a lot of the times I create a new test by
taking an old test, copy that to a new file and start modifying
it. The problem is that I sometimes forget to change the class name.
When this happens, tests still work but one class of tests has
silently been discarded.
A colleague, Martin Davis, came up with this simple, short monkeypatch
to hook onto method_added to check for this condition. It works very
well. I think this would be a great addition to Test::Unit::TestCase
in test/unit/testcase.rb
Until then, here’s a little file you can load/require: