Sha256: 87485749eb22011331940b98f1f457b15165febe6f0859b011057546e95cc9a5

Contents?: true

Size: 638 Bytes

Versions: 18

Compression:

Stored size: 638 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'
  end

  it_should_behave_like "a string-only command"
end

Version data entries

18 entries across 18 versions & 1 rubygems

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