diff --git a/lib/redis/client.rb b/lib/redis/client.rb index c867f633b..31be2de33 100644 --- a/lib/redis/client.rb +++ b/lib/redis/client.rb @@ -451,12 +451,12 @@ def _parse_options(options) case options[:tcp_keepalive] when Hash [:time, :intvl, :probes].each do |key| - unless options[:tcp_keepalive][key].is_a?(Fixnum) - raise "Expected the #{key.inspect} key in :tcp_keepalive to be a Fixnum" + unless options[:tcp_keepalive][key].is_a?(Integer) + raise "Expected the #{key.inspect} key in :tcp_keepalive to be an Integer" end end - when Fixnum + when Integer if options[:tcp_keepalive] >= 60 options[:tcp_keepalive] = {:time => options[:tcp_keepalive] - 20, :intvl => 10, :probes => 2} diff --git a/test/remote_server_control_commands_test.rb b/test/remote_server_control_commands_test.rb index b5cbd452e..3ca9f879e 100644 --- a/test/remote_server_control_commands_test.rb +++ b/test/remote_server_control_commands_test.rb @@ -101,7 +101,7 @@ def test_object assert_equal 1, r.object(:refcount, "list") encoding = r.object(:encoding, "list") assert "ziplist" == encoding || "quicklist" == encoding, "Wrong encoding for list" - assert r.object(:idletime, "list").kind_of?(Fixnum) + assert r.object(:idletime, "list").kind_of?(Integer) end def test_sync