I was wondering if anyone has a clever way of testing behavior after a redis key expires. I am essentially building a small redis backed cache for my application and would like to test what happens after a redis key is set to expire.
I am using rspec as my testing framework. I tried to use Timecop to change the time during testing but realized that it would only effect the testing frame work and not the external redis server.
I can set the TTL to 1 and then use a sleep(1) but I would rather not introduce sleeps into my tests.
Does anyone have a good way of testing this?