test/command_map_test.rb in redis-3.0.0.rc1 vs test/command_map_test.rb in redis-3.0.0.rc2

- old
+ new

@@ -1,29 +1,30 @@ # encoding: UTF-8 -require File.expand_path("./helper", File.dirname(__FILE__)) +require "helper" -setup do - init Redis.new(OPTIONS) -end +class TestCommandMap < Test::Unit::TestCase -test "Override existing commands" do |r| - r.set("counter", 1) + include Helper::Client - assert 2 == r.incr("counter") + def test_override_existing_commands + r.set("counter", 1) - r.client.command_map[:incr] = :decr + assert_equal 2, r.incr("counter") - assert 1 == r.incr("counter") -end + r.client.command_map[:incr] = :decr -test "Override non-existing commands" do |r| - r.set("key", "value") - - assert_raise Redis::CommandError do - r.idontexist("key") + assert_equal 1, r.incr("counter") end - r.client.command_map[:idontexist] = :get + def test_override_non_existing_commands + r.set("key", "value") - assert "value" == r.idontexist("key") + assert_raise Redis::CommandError do + r.idontexist("key") + end + + r.client.command_map[:idontexist] = :get + + assert_equal "value", r.idontexist("key") + end end