Sha256: e92daa0f64222ce647ca61deb49e2ab26f5cedac22efe65a9176a23da58b727b

Contents?: true

Size: 430 Bytes

Versions: 12

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

12 entries across 12 versions & 1 rubygems

Version Path
mock_redis-0.18.0 spec/commands/strlen_spec.rb
mock_redis-0.17.3 spec/commands/strlen_spec.rb
mock_redis-0.17.2 spec/commands/strlen_spec.rb
mock_redis-0.17.1 spec/commands/strlen_spec.rb
mock_redis-0.17.0 spec/commands/strlen_spec.rb
mock_redis-0.16.1 spec/commands/strlen_spec.rb
mock_redis-0.16.0 spec/commands/strlen_spec.rb
mock_redis-0.15.4 spec/commands/strlen_spec.rb
mock_redis-0.15.3 spec/commands/strlen_spec.rb
mock_redis-0.15.2 spec/commands/strlen_spec.rb
mock_redis-0.15.1 spec/commands/strlen_spec.rb
mock_redis-0.15.0 spec/commands/strlen_spec.rb