Sha256: c2b1029629dca47da3cd13edf5f3c9c444f4c556c952f206307a6add542aca43

Contents?: true

Size: 430 Bytes

Versions: 39

Compression:

Stored size: 430 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe "#strlen(key)" do
  before do
    @key = 'mock-redis-test:73288'
    @redises.set(@key, "5 ∈ (0..10)")
  end

  it "returns the string's length in bytes" do
    @redises.strlen(@key).should == 13
  end

  it "returns 0 for a nonexistent value" do
    @redises.strlen('mock-redis-test:does-not-exist').should == 0
  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/strlen_spec.rb
mock_redis-0.14.0 spec/commands/strlen_spec.rb
mock_redis-0.13.2 spec/commands/strlen_spec.rb
mock_redis-0.13.1 spec/commands/strlen_spec.rb
mock_redis-0.13.0 spec/commands/strlen_spec.rb
mock_redis-0.12.1 spec/commands/strlen_spec.rb
mock_redis-0.12.0 spec/commands/strlen_spec.rb
mock_redis-0.11.0 spec/commands/strlen_spec.rb
mock_redis-0.10.0 spec/commands/strlen_spec.rb
mock_redis-0.9.0 spec/commands/strlen_spec.rb
mock_redis-0.8.2 spec/commands/strlen_spec.rb
mock_redis-0.8.1 spec/commands/strlen_spec.rb
mock_redis-0.8.0 spec/commands/strlen_spec.rb
mock_redis-0.7.0 spec/commands/strlen_spec.rb
mock_redis-0.6.6 spec/commands/strlen_spec.rb
mock_redis-0.6.5 spec/commands/strlen_spec.rb
mock_redis-0.6.4 spec/commands/strlen_spec.rb
mock_redis-0.6.3 spec/commands/strlen_spec.rb
mock_redis-0.6.2 spec/commands/strlen_spec.rb
mock_redis-0.6.1 spec/commands/strlen_spec.rb