diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-12 11:51:28 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-12 11:51:28 -0700 |
commit | 0210c44cd31ac4711e8d510c418fb325e3f44fa9 (patch) | |
tree | acb6f03646f2358d2fd79670b79023015899d4d7 /activerecord/test/cases/connection_pool_test.rb | |
parent | 7f40b9cd429cabad80ef9d8fbe3a169d14bf1dba (diff) | |
download | rails-0210c44cd31ac4711e8d510c418fb325e3f44fa9.tar.gz rails-0210c44cd31ac4711e8d510c418fb325e3f44fa9.tar.bz2 rails-0210c44cd31ac4711e8d510c418fb325e3f44fa9.zip |
make sure connections returned after close are marked as in_use
Diffstat (limited to 'activerecord/test/cases/connection_pool_test.rb')
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 861ae7e120..da93500ce3 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -31,6 +31,16 @@ module ActiveRecord pool.connections.find_all(&:in_use?) end + def test_checkout_after_close + connection = pool.connection + assert connection.in_use? + + connection.close + assert !connection.in_use? + + assert pool.connection.in_use? + end + def test_released_connection_moves_between_threads thread_conn = nil |