mysqlplus/test/reconnected_test.rb
2008-10-08 17:09:47 +01:00

18 lines
314 B
Ruby

require File.dirname(__FILE__) + '/test_helper'
$m = Mysql.real_connect('localhost','root')
#$m.reconnect = true
def assert_reconnected
puts $m.reconnected?().inspect
sleep 1
yield
puts $m.reconnected?().inspect
end
assert_reconnected do
$m.simulate_disconnect
end
assert_reconnected do
$m.close
end