This post illustrates mock objects, and other good techniques, using active-merchant as its example code:
Radar – O’Reilly