Permalink
Browse files

Fix typo: was using brackets instead of parens. Must need more sleep.

  • Loading branch information...
1 parent 1712e37 commit d7d2d73d88e465cb0c618283862179accd8932e1 @nicksieger nicksieger committed Aug 8, 2008
@@ -266,7 +266,7 @@ def checkout_new_connection
end
def checkout_existing_connection
- c = [@connections - @checked_out].first
+ c = (@connections - @checked_out).first
@checked_out << c
c
end
@@ -105,5 +105,15 @@ def test_pooled_connection_checkin_two
assert_equal 3, @connection_count
assert_equal 0, @timed_out
end
+
+ def test_pooled_connection_checkout_existing_first
+ ActiveRecord::Base.establish_connection(@connection.merge({:pool => 1}))
+ conn_pool = ActiveRecord::Base.connection_pool
+ conn = conn_pool.checkout
+ conn_pool.checkin(conn)
+ conn = conn_pool.checkout
+ assert ActiveRecord::ConnectionAdapters::AbstractAdapter === conn
+ conn_pool.checkin(conn)
+ end
end
end

0 comments on commit d7d2d73

Please sign in to comment.