test/internals_test.rb in redis-3.0.1 vs test/internals_test.rb in redis-3.0.2

- old
+ new

@@ -96,9 +96,27 @@ assert_nothing_raised do Redis.new(OPTIONS.merge(:timeout => 0)) end end + driver(:ruby) do + def test_tcp_keepalive + keepalive = {:time => 20, :intvl => 10, :probes => 5} + + redis = Redis.new(OPTIONS.merge(:tcp_keepalive => keepalive)) + redis.ping + + connection = redis.client.connection + actual_keepalive = connection.get_tcp_keepalive + + [:time, :intvl, :probes].each do |key| + if actual_keepalive.has_key?(key) + assert_equal actual_keepalive[key], keepalive[key] + end + end + end + end + def test_time return if version < "2.5.4" # Test that the difference between the time that Ruby reports and the time # that Redis reports is minimal (prevents the test from being racy).