diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-29 13:15:20 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-29 14:02:58 -0800 |
commit | 134cc8f9398a9a67b80f3cc26651dcc5c073416c (patch) | |
tree | 68e3d5d2fc7bc831700466951f8ffce86e75ec4f /activerecord/test | |
parent | 9bf8bf82b9d8614d9c7ccc31892887f6a79ce2f5 (diff) | |
download | rails-134cc8f9398a9a67b80f3cc26651dcc5c073416c.tar.gz rails-134cc8f9398a9a67b80f3cc26651dcc5c073416c.tar.bz2 rails-134cc8f9398a9a67b80f3cc26651dcc5c073416c.zip |
Leased connections return false on second lease
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_adapters/abstract_adapter_test.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb index ef6a57d328..b2e747c507 100644 --- a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb +++ b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb @@ -3,14 +3,23 @@ require "cases/helper" module ActiveRecord module ConnectionAdapters class AbstractAdapterTest < ActiveRecord::TestCase - def test_in_use? - adapter = AbstractAdapter.new nil, nil + attr_reader :adapter + + def setup + @adapter = AbstractAdapter.new nil, nil + end + def test_in_use? # FIXME: change to refute in Rails 4.0 / mt assert !adapter.in_use?, 'adapter is not in use' assert adapter.lease, 'lease adapter' assert adapter.in_use?, 'adapter is in use' end + + def test_lease_twice + assert adapter.lease, 'should lease adapter' + assert !adapter.lease, 'should not lease adapter' + end end end end |