aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-04-24 16:39:56 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-04-24 16:39:56 -0700
commit3e067c07fc6b51126e7c200461cbf298c2f48048 (patch)
tree9f502c6fddd4a02cad276986c57788c6d0807b3c /activerecord
parente691272628ea1bc5b860fbfb5ffc76f1997a5364 (diff)
parentdf0cb9e34cf922656426f8958a41b4bbe1a0058c (diff)
downloadrails-3e067c07fc6b51126e7c200461cbf298c2f48048.tar.gz
rails-3e067c07fc6b51126e7c200461cbf298c2f48048.tar.bz2
rails-3e067c07fc6b51126e7c200461cbf298c2f48048.zip
Merge pull request #10333 from ikataitsev/move-test-method-to-tests
Move method used only in the test to the test code itself
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb8
-rw-r--r--activerecord/test/cases/connection_adapters/abstract_adapter_test.rb9
2 files changed, 9 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index bf2f945448..816b397fcf 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -253,14 +253,6 @@ module ActiveRecord
@available = Queue.new self
end
- # Hack for tests to be able to add connections. Do not call outside of tests
- def insert_connection_for_test!(c) #:nodoc:
- synchronize do
- @connections << c
- @available.add c
- end
- end
-
# Retrieve the connection associated with the current thread, or call
# #checkout to obtain one if necessary.
#
diff --git a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
index 1fd64dd0af..eb2fe5639b 100644
--- a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
+++ b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
@@ -2,6 +2,15 @@ require "cases/helper"
module ActiveRecord
module ConnectionAdapters
+ class ConnectionPool
+ def insert_connection_for_test!(c)
+ synchronize do
+ @connections << c
+ @available.add c
+ end
+ end
+ end
+
class AbstractAdapterTest < ActiveRecord::TestCase
attr_reader :adapter