Sha256: b3a5be55e7a49ab3f76a0774fdebfdf21b755ec31a86e091856ea7b14f76428a
Contents?: true
Size: 798 Bytes
Versions: 11
Compression:
Stored size: 798 Bytes
Contents
require "spec_helper" module Twitchus describe Storage do it "will add things to the given key" do client = mock(:redis) client.should_receive(:lpush).with(:key, :item) Redis.should_receive(:new) { client } storage = Storage.new(1, 1, :key) storage.push :item end it "won't add empty items to the list" do client = mock(:redis) client.should_not_receive(:lpush).with(:key, nil) Redis.should_receive(:new) { client } storage = Storage.new(1, 1, :key) storage.push nil end it "can empty the storage" do client = mock(:redis) client.should_receive(:expire).with(:key, -1) Redis.should_receive(:new) { client } storage = Storage.new(1, 1, :key) storage.clear end end end
Version data entries
11 entries across 11 versions & 1 rubygems