praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
421 stars 131 forks source link

Create recording test double for riak and redis. #595

Open hodgestar opened 11 years ago

hodgestar commented 11 years ago

Martin Fowler suggested that the way to deal with complex external dependencies in tests is to create a recording test double. This double can run either as a proxy that calls the real implementation, or as a mock that returns stored values.

When run in recording mode it:

When run in playback mode it:

This gives us both the ability to run against real Redis or Riak when needed, but also the ability to be independent of Redis or RIak hiccups and changes and to have faster tests.

smn commented 11 years ago

:cake: