Sha256: 503f1a92d7fca2099e95e53d481bf62fff1da4b5a52ba7e2529aaebeaf7d5e83

Contents?: true

Size: 542 Bytes

Versions: 11

Compression:

Stored size: 542 Bytes

Contents

# encoding: UTF-8

require "helper"

class TestCommandMap < Test::Unit::TestCase

  include Helper::Client

  def test_override_existing_commands
    r.set("counter", 1)

    assert_equal 2, r.incr("counter")

    r.client.command_map[:incr] = :decr

    assert_equal 1, r.incr("counter")
  end

  def test_override_non_existing_commands
    r.set("key", "value")

    assert_raise Redis::CommandError do
      r.idontexist("key")
    end

    r.client.command_map[:idontexist] = :get

    assert_equal "value", r.idontexist("key")
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
redis-3.0.5 test/command_map_test.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/redis-3.0.4/test/command_map_test.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/redis-3.0.4/test/command_map_test.rb
redis-3.0.4 test/command_map_test.rb
redis-3.0.3 test/command_map_test.rb
remq-0.0.4 vendor/bundle/gems/redis-3.0.2/test/command_map_test.rb
remq-0.0.3 vendor/bundle/gems/redis-3.0.2/test/command_map_test.rb
redis-3.0.2 test/command_map_test.rb
redis-3.0.1 test/command_map_test.rb
redis-3.0.0 test/command_map_test.rb
redis-3.0.0.rc2 test/command_map_test.rb