Sha256: 574b32758445d0702401ebc8813a2fd89f1a4432cb118e852968b6947abe2cd5

Contents?: true

Size: 528 Bytes

Versions: 39

Compression:

Stored size: 528 Bytes

Contents

require 'spec_helper'

describe "#getrange(key, start, stop)" do
  before do
    @key = 'mock-redis-test:getrange'
    @redises.set(@key, "This is a string")
  end

  it "returns a substring" do
    @redises.getrange(@key, 0, 3).should == "This"
  end

  it "works with negative indices" do
    @redises.getrange(@key, -3, -1).should == "ing"
  end

  it "limits the result to the actual length of the string" do
    @redises.getrange(@key, 10, 100).should == "string"
  end

  it_should_behave_like "a string-only command"
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
mock_redis-0.14.1 spec/commands/getrange_spec.rb
mock_redis-0.14.0 spec/commands/getrange_spec.rb
mock_redis-0.13.2 spec/commands/getrange_spec.rb
mock_redis-0.13.1 spec/commands/getrange_spec.rb
mock_redis-0.13.0 spec/commands/getrange_spec.rb
mock_redis-0.12.1 spec/commands/getrange_spec.rb
mock_redis-0.12.0 spec/commands/getrange_spec.rb
mock_redis-0.11.0 spec/commands/getrange_spec.rb
mock_redis-0.10.0 spec/commands/getrange_spec.rb
mock_redis-0.9.0 spec/commands/getrange_spec.rb
mock_redis-0.8.2 spec/commands/getrange_spec.rb
mock_redis-0.8.1 spec/commands/getrange_spec.rb
mock_redis-0.8.0 spec/commands/getrange_spec.rb
mock_redis-0.7.0 spec/commands/getrange_spec.rb
mock_redis-0.6.6 spec/commands/getrange_spec.rb
mock_redis-0.6.5 spec/commands/getrange_spec.rb
mock_redis-0.6.4 spec/commands/getrange_spec.rb
mock_redis-0.6.3 spec/commands/getrange_spec.rb
mock_redis-0.6.2 spec/commands/getrange_spec.rb
mock_redis-0.6.1 spec/commands/getrange_spec.rb