Sha256: c61817dc6e31bb8225c4c404ddb11e98311536b345a9c93470c2d9de8d7885ad

Contents?: true

Size: 1.56 KB

Versions: 33

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

describe '#info [mock only]' do
  let(:redis) { @redises.mock }

  it 'responds with a config hash' do
    redis.info.should be_a(Hash)
  end

  it 'gets default set of info' do
    info = redis.info
    info['arch_bits'].should be_a(String)
    info['connected_clients'].should be_a(String)
    info['aof_rewrite_scheduled'].should be_a(String)
    info['used_cpu_sys'].should be_a(String)
  end

  it 'gets all info' do
    info = redis.info(:all)
    info['arch_bits'].should be_a(String)
    info['connected_clients'].should be_a(String)
    info['aof_rewrite_scheduled'].should be_a(String)
    info['used_cpu_sys'].should be_a(String)
    info['cmdstat_slowlog'].should be_a(String)
  end

  it 'gets server info' do
    redis.info(:server)['arch_bits'].should be_a(String)
  end

  it 'gets clients info' do
    redis.info(:clients)['connected_clients'].should be_a(String)
  end

  it 'gets memory info' do
    redis.info(:memory)['used_memory'].should be_a(String)
  end

  it 'gets persistence info' do
    redis.info(:persistence)['aof_rewrite_scheduled'].should be_a(String)
  end

  it 'gets stats info' do
    redis.info(:stats)['keyspace_hits'].should be_a(String)
  end

  it 'gets replication info' do
    redis.info(:replication)['role'].should be_a(String)
  end

  it 'gets cpu info' do
    redis.info(:cpu)['used_cpu_sys'].should be_a(String)
  end

  it 'gets keyspace info' do
    redis.info(:keyspace)['db0'].should be_a(String)
  end

  it 'gets commandstats info' do
    redis.info(:commandstats)['sunionstore']['usec'].should be_a(String)
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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