Sha256: 60c47df196bc1930f8ae2013eb3f1aa75d7c5b8ffda94d63bdd37f85e4086959
Contents?: true
Size: 1.32 KB
Versions: 19
Compression:
Stored size: 1.32 KB
Contents
require 'spec_helper' describe Internals::Index::Redis::Basic do let(:redis) { described_class.new "some_namespace" } describe 'load, retrieve, backup, delete' do it 'is nothing they do (at least on the backend)' do redis.should_receive(:backend).never redis.load redis.retrieve redis.backup redis.delete end end describe 'cache_small?' do context 'size 0' do before(:each) do redis.stub! :size => 0 end it 'is small' do redis.cache_small?.should == true end end context 'size 1' do before(:each) do redis.stub! :size => 1 end it 'is not small' do redis.cache_small?.should == false end end end describe 'cache_ok?' do context 'size 0' do before(:each) do redis.stub! :size => 0 end it 'is not ok' do redis.cache_ok?.should == false end end context 'size 1' do before(:each) do redis.stub! :size => 1 end it 'is ok' do redis.cache_ok?.should == true end end end describe "size" do it 'delegates to the backend' do backend = stub :backend redis.stub! :backend => backend backend.should_receive(:dbsize).once.with redis.size end end end
Version data entries
19 entries across 19 versions & 1 rubygems