Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Testing redis key expiration

$
0
0

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?


Viewing all articles
Browse latest Browse all 873

Trending Articles