Sha256: bc5969b6936a55c8961e2b27405c3721aabaf7f7cbd5eb7ed16faa50046ac7ae
Contents?: true
Size: 890 Bytes
Versions: 21
Compression:
Stored size: 890 Bytes
Contents
require 'spec_helper' describe '#rename(key, newkey)' do before do @key = 'mock-redis-test:rename:key' @newkey = 'mock-redis-test:rename:newkey' @redises.set(@key, "oof") end it "responds with 'OK'" do @redises.rename(@key, @newkey).should == 'OK' end it "moves the data" do @redises.rename(@key, @newkey) @redises.get(@newkey).should == "oof" end it "raises an error when the source key is nonexistant" do @redises.del(@key) lambda do @redises.rename(@key, @newkey) end.should raise_error(Redis::CommandError) end it "raises an error when key == newkey" do lambda do @redises.rename(@key, @key) end.should raise_error(RuntimeError) end it "overwrites any existing value at newkey" do @redises.set(@newkey, "rab") @redises.rename(@key, @newkey) @redises.get(@newkey).should == "oof" end end
Version data entries
21 entries across 21 versions & 1 rubygems