Sha256: bfb5c474465ccaaeb30d22257ff02d2b3675ce3c7a3b3af5978c5f2c4cb3af44

Contents?: true

Size: 771 Bytes

Versions: 33

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

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

  it "returns 'none' for no key" do
    @redises.type(@key).should == 'none'
  end

  it "returns 'string' for a string" do
    @redises.set(@key, 'stringlish')
    @redises.type(@key).should == 'string'
  end

  it "returns 'list' for a list" do
    @redises.lpush(@key, 100)
    @redises.type(@key).should == 'list'
  end

  it "returns 'hash' for a hash" do
    @redises.hset(@key, 100, 200)
    @redises.type(@key).should == 'hash'
  end

  it "returns 'set' for a set" do
    @redises.sadd(@key, 100)
    @redises.type(@key).should == 'set'
  end

  it "returns 'zset' for a zset" do
    @redises.zadd(@key, 1, 2)
    @redises.type(@key).should == 'zset'
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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