From: Matt Armstrong Date: 2003-02-14T02:09:38+09:00 Subject: Unit testing or mocking Net::SMTP Say I have a class that sends mail. It has a method with this in it: Net::SMTP.start(host) { |smtp| smtp.send_mail(message, sender, *recipients) } How can I best unit test this? Should I alias Net::SMTP.start to something else and replace it with a mock implementation in my test case's startup, then restore it in teardown? Any libraries or examples of where this is done elegantly? -- matt