Sha256: d31ccfe50eef783e41ca5e762763832ef7241c4d94c19fae61946ad226075d50

Contents?: true

Size: 678 Bytes

Versions: 20

Compression:

Stored size: 678 Bytes

Contents

require 'spec_helper'

describe '#get(key)' do
  before do
    @key = 'mock-redis-test:73288'
  end

  it 'returns nil for a nonexistent value' do
    @redises.get('mock-redis-test:does-not-exist').should be_nil
  end

  it 'returns a stored string value' do
    @redises.set(@key, 'forsooth')
    @redises.get(@key).should == 'forsooth'
  end

  it 'treats integers as strings' do
    @redises.set(@key, 100)
    @redises.get(@key).should == '100'
  end

  it 'stringifies key' do
    key = :a_symbol

    @redises.set(key, 'hello')
    @redises.get(key.to_s).should == 'hello'
    @redises.get(key).should == 'hello'
  end

  it_should_behave_like 'a string-only command'
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mock_redis-0.36.0 spec/commands/get_spec.rb
mock_redis-0.35.0 spec/commands/get_spec.rb
mock_redis-0.34.0 spec/commands/get_spec.rb
mock_redis-0.33.0 spec/commands/get_spec.rb
mock_redis-0.32.0 spec/commands/get_spec.rb
mock_redis-0.31.0 spec/commands/get_spec.rb
mock_redis-0.30.0 spec/commands/get_spec.rb
mock_redis-0.29.0 spec/commands/get_spec.rb
mock_redis-0.28.0 spec/commands/get_spec.rb
mock_redis-0.27.3 spec/commands/get_spec.rb
mock_redis-0.27.2 spec/commands/get_spec.rb
mock_redis-0.27.1 spec/commands/get_spec.rb
mock_redis-0.27.0 spec/commands/get_spec.rb
mock_redis-0.26.0 spec/commands/get_spec.rb
mock_redis-0.25.0 spec/commands/get_spec.rb
mock_redis-0.24.0 spec/commands/get_spec.rb
mock_redis-0.23.0 spec/commands/get_spec.rb
mock_redis-0.22.0 spec/commands/get_spec.rb
mock_redis-0.21.0 spec/commands/get_spec.rb
mock_redis-0.20.0 spec/commands/get_spec.rb