Sha256: f9b95fa230671175aea6f67012c153c66868a15f9cbab213a6ac83a042130fb9

Contents?: true

Size: 584 Bytes

Versions: 21

Compression:

Stored size: 584 Bytes

Contents

# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))

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

21 entries across 20 versions & 7 rubygems

Version Path
finsync_redis-3.3.5 test/command_map_test.rb
redis-3.3.5 test/command_map_test.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/command_map_test.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/command_map_test.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/command_map_test.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/command_map_test.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/test/command_map_test.rb
redis-3.3.3 test/command_map_test.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/test/command_map_test.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/test/command_map_test.rb
redis-3.3.2 test/command_map_test.rb
redis-3.3.1 test/command_map_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/test/command_map_test.rb
redis-3.3.0 test/command_map_test.rb
discourse-redis-3.2.2 test/command_map_test.rb
redis-3.2.2 test/command_map_test.rb
redis-3.2.1 test/command_map_test.rb
redis-3.2.0 test/command_map_test.rb
redis-3.1.0 test/command_map_test.rb
redis-3.0.7 test/command_map_test.rb