I was wondering if anyone has a smart way to test behavior after the redis key has expired. I essentially create a small redis redundant cache for my application and would like to check what happens after the redis key expires.
I use rspec as a testing framework. I tried using Timecop to change the time during testing, but realized that this would only affect the operation of the test frame, and not the external redis server.
I can set TTL to 1 and then use sleep (1), but I would prefer not to introduce sleep in my tests.
Does anyone have a good way to test this?
source
share