Sha256: 9bbead5e1b28c6a6699b0b5eae2d367a7627b3ba55660f8c0a413a427e7268a9
Contents?: true
Size: 788 Bytes
Versions: 39
Compression:
Stored size: 788 Bytes
Contents
require 'spec_helper' describe "#setrange(key, offset, value)" do before do @key = 'mock-redis-test:setrange' @redises.set(@key, "This is a string") end it "returns the string's new length" do @redises.setrange(@key, 0, "That").should == 16 end it "updates part of the string" do @redises.setrange(@key, 0, "That") @redises.get(@key).should == "That is a string" end it "zero-pads the string if necessary" do @redises.setrange(@key, 20, "X") @redises.get(@key).should == "This is a string\000\000\000\000X" end it "stores things as strings" do other_key = "mock-redis-test:setrange-other-key" @redises.setrange(other_key, 0, 1) @redises.get(other_key).should == "1" end it_should_behave_like "a string-only command" end
Version data entries
39 entries across 39 versions & 2 rubygems