Sha256: db19ded4c5e1a6a1ea518cd898bb636d57b4e8295c3db1eae4704b3276da94b1

Contents?: true

Size: 771 Bytes

Versions: 39

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

39 entries across 39 versions & 2 rubygems

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