Redis at Causes and a Redis Mock Library
Two interesting things in this post.
First is using Redis for tracking results for A/B testing:
We here at Causes are pretty big fans of Redis. We use it to track the results of A/B testing with Modesty, our internal health-tracking app uses Redis as its sole datastore, and we’ve used the Redis-backed Resque in an app or two. However, it has been painful to write tests around our Redis-using code.
And the second is creating a Redis mock library for testing purposes:
That’s why we wrote mock_redis. It’s a Redis mock, so you can use it like you would a real Redis object. It’s just a Ruby object, so it’s confined to your Ruby process. Other test runs can’t step on your Redis data, and you can’t step on theirs. The best part is, mock_redis behaves just like a real Redis does in your tests. Transactions? Yep. Hashes, lists, and sorted sets? Check. Multiple databases? Got it. Working expiration? Yes indeed.
Original title and link: Redis at Causes and a Redis Mock Library (©myNoSQL)
via: http://exchange.causes.com/2011/07/causes-tech-finally-a-usable-redis-mock/