Sha256: 350652d439c7a5889718e92fb1e1455489d5a4d0e4ae13efa2b62d29bd0396a0

Contents?: true

Size: 1013 Bytes

Versions: 52

Compression:

Stored size: 1013 Bytes

Contents

# encoding: UTF-8

require File.expand_path("./helper", File.dirname(__FILE__))
require "redis/distributed"

setup do
  log = StringIO.new
  init Redis::Distributed.new(NODES, :logger => ::Logger.new(log))
end

test "INFO" do |r|
  %w(last_save_time redis_version total_connections_received connected_clients total_commands_processed connected_slaves uptime_in_seconds used_memory uptime_in_days changes_since_last_save).each do |x|
    r.info.each do |info|
      assert info.keys.include?(x)
    end
  end
end

test "INFO COMMANDSTATS" do |r|
  # Only available on Redis >= 2.3.0
  next if r.info.first["redis_version"] < "2.3.0"

  r.nodes.each { |n| n.config(:resetstat) }
  r.ping # Executed on every node

  r.info(:commandstats).each do |info|
    assert "1" == info["ping"]["calls"]
  end
end

test "MONITOR" do |r|
  begin
    r.monitor
  rescue Exception => ex
  ensure
    assert ex.kind_of?(NotImplementedError)
  end
end

test "ECHO" do |r|
  assert ["foo bar baz\n"] == r.echo("foo bar baz\n")
end

Version data entries

52 entries across 52 versions & 6 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.5 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.4 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.3 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.2 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.1 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.7.0 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.9 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.8 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.7 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.6 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.5 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.4 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.3 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.2 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.1 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.6.0 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.5.17 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.5.16 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb
classiccms-0.5.15 vendor/bundle/gems/redis-2.2.2/test/distributed_remote_server_control_commands_test.rb