causes/mock_redis — pull request #93 by kcdragon (2014-06-21 03:02:13+00:00)
Title: Returning futures in transaction wrapper when #multi block is used

Commands inside a multi transaction always return the String 'QUEUED'. The Redis gem returns a "future" that allows the value to be accessed after #exec is called.

This pull request adds support for futures in the transaction wrapper.

One thing to note about the spec I wrote is that I had an issue with the RedisMultiplexer. The issue I ran into was that the "real" Redis is evaluated after the "mock" Redis inside the multiplexer so the futures I saved for later were always the "real" ones, so the tests always passed regardless of what the "mock" Redis returned. I was able to get this test working by swapping the order of the calls ("mock" is evaluated after "real"). Let me know if this is not desirable for other reasons and I can just call MockRedis directly in my test instead of the multiplexer.