Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 342 Bytes
class FakeRedis < Hash
def initialize
super
@keys_to_expire = []
end
def expire(key, ttl)
@keys_to_expire << key
end
def expire!
@keys_to_expire.each { |key| delete(key) }
@keys_to_expire = []
end
def dbsize
keys.size
end
def del(*keys)
keys.each do |key|
delete(key)
end
end
end